CorpusItem.vue 952 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <template>
  2. <article class="corpus item">
  3. <header>
  4. <h1>
  5. <a
  6. :href="item.url"
  7. @click.prevent="onclick"
  8. @keyup.enter="onclick"
  9. v-html="item.title"
  10. />
  11. </h1>
  12. </header>
  13. <section>
  14. <p class="author">{{ item.author }}</p>
  15. <p class="date">{{ item.date }}</p>
  16. <p class="editions-quantity">{{ item.editionsQuantity }}</p>
  17. <p class="text-quantity">{{ item.textsQuantity }}</p>
  18. <div class="edition" v-html="item.editions" />
  19. </section>
  20. </article>
  21. </template>
  22. <script>
  23. export default {
  24. name: 'CorpusItem',
  25. props: {
  26. item: {
  27. type: Object,
  28. required: true
  29. }
  30. },
  31. data: () => ({
  32. }),
  33. methods: {
  34. onclick () {
  35. console.log('clicked on corpus item', this.item)
  36. this.$router.push({
  37. name: `corpus`,
  38. params: { id: this.item.uuid }
  39. })
  40. }
  41. }
  42. }
  43. </script>
  44. <style lang="scss" scoped>
  45. </style>