FooterTabs.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <template>
  2. <div id="footer-tabs" class="col-1">
  3. <ul>
  4. <li class="history">
  5. <div class="wrapper">
  6. <span>Historique de consultation</span>
  7. </div>
  8. </li>
  9. <li class="results">
  10. <div class="wrapper">
  11. <transition name="fade" appear>
  12. <span
  13. v-if="resultsItems.length && !resultsOpened"
  14. title="Ouvrir les resultats"
  15. @click.prevent="openResults"
  16. @keydown.enter.prevent="openResults"
  17. >
  18. Resultas
  19. </span>
  20. </transition>
  21. </div>
  22. </li>
  23. </ul>
  24. </div>
  25. </template>
  26. <script>
  27. import { mapState } from 'vuex'
  28. export default {
  29. name: 'FooterTabs',
  30. computed: {
  31. resultsOpened: {
  32. get () { return this.$store.state.Search.opened },
  33. set (value) { this.$store.commit('Search/setOpened', value) }
  34. },
  35. ...mapState({
  36. resultsItems: state => state.Search.results
  37. })
  38. },
  39. methods: {
  40. openResults () {
  41. this.resultsOpened = true
  42. }
  43. }
  44. }
  45. </script>
  46. <style lang="scss" scoped>
  47. </style>