HistoryItem.vue 1015 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <template>
  2. <article class="result item">
  3. <h1>
  4. <a
  5. :href="'/edition/'+item.id+'/'+item.textid"
  6. @click.prevent="onclick"
  7. @keyup.enter="onclick"
  8. v-html="item.title"
  9. />
  10. </h1>
  11. <h2>
  12. <a
  13. :href="'/edition/'+item.id+'/'+item.textid"
  14. @click.prevent="onclick"
  15. @keyup.enter="onclick"
  16. v-html="item.editionTitle"
  17. />
  18. </h2>
  19. <!-- <p v-if="preview" class="preview" v-html="preview" /> -->
  20. <aside>
  21. <span>Pagination</span> | <span>Nbr mots</span>
  22. </aside>
  23. </article>
  24. </template>
  25. <script>
  26. import { mapActions } from 'vuex'
  27. export default {
  28. name: 'HistoryItem',
  29. props: {
  30. item: {
  31. type: Object,
  32. required: true
  33. }
  34. },
  35. methods: {
  36. ...mapActions({
  37. navigateToHistoryItem: 'History/navigateToItem'
  38. }),
  39. onclick () {
  40. console.log('clicked on history item', this.item)
  41. this.navigateToHistoryItem(this.item)
  42. }
  43. }
  44. }
  45. </script>
  46. <style lang="scss" scoped>
  47. </style>