IndexItemOcurrences.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <section class="occurences">
  3. <ul>
  4. <li
  5. v-for="ed in content.occurences"
  6. :key="ed.item"
  7. >
  8. <h3>
  9. <a
  10. :href="'/edition/'+ed.item"
  11. :uuid="ed.item"
  12. @click.prevent="onclick"
  13. @keyup.enter="onclick"
  14. >
  15. {{ ed.item }}
  16. </a>
  17. </h3>
  18. <ul>
  19. <li
  20. v-for="oc in ocAsArray(ed.occurences)"
  21. :key="oc.id"
  22. >
  23. <!-- <li
  24. v-for="oc in ed.occurences"
  25. :key="oc.uuid"
  26. > -->
  27. <occurence :ed="ed" :oc="oc" />
  28. </li>
  29. </ul>
  30. </li>
  31. </ul>
  32. </section>
  33. </template>
  34. <script>
  35. import Occurence from './Occurence'
  36. export default {
  37. name: 'IndexItemOcurrences',
  38. components: {
  39. Occurence
  40. },
  41. props: {
  42. content: Object
  43. },
  44. data: () => ({
  45. }),
  46. methods: {
  47. ocAsArray (oc) {
  48. // not necesseary anymore (KB #758)
  49. console.log('Array.isArray(oc)', Array.isArray(oc))
  50. return Array.isArray(oc) ? oc : [oc]
  51. }
  52. }
  53. }
  54. </script>
  55. <style lang="scss" scoped>
  56. </style>