NominumItem.vue 783 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <template>
  2. <article class="nominum 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. <p v-if="item.birth && item.death">
  13. <span>{{ item.birth }}</span> -- <span>{{ item.death }}</span>
  14. </p>
  15. </header>
  16. </article>
  17. </template>
  18. <script>
  19. export default {
  20. name: 'NominumItem',
  21. props: {
  22. item: {
  23. type: Object,
  24. required: true
  25. }
  26. },
  27. data: () => ({
  28. }),
  29. methods: {
  30. onclick () {
  31. console.log('clicked on nominum item', this.item)
  32. this.$router.push({
  33. name: `nominum`,
  34. params: { id: this.item.uuid }
  35. })
  36. }
  37. }
  38. }
  39. </script>
  40. <style lang="scss" scoped>
  41. </style>