LocorumItem.vue 729 B

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