IndexItemOcurrences.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. v-html="ed.biblio"
  15. />
  16. </h3>
  17. <ul>
  18. <li
  19. v-for="oc in ocAsArray(ed.occurences)"
  20. :key="oc.id"
  21. >
  22. <!-- <li
  23. v-for="oc in ed.occurences"
  24. :key="oc.uuid"
  25. > -->
  26. <occurence :ed="ed" :oc="oc" />
  27. </li>
  28. </ul>
  29. </li>
  30. </ul>
  31. </section>
  32. </template>
  33. <script>
  34. import Occurence from './Occurence'
  35. export default {
  36. name: 'IndexItemOcurrences',
  37. components: {
  38. Occurence
  39. },
  40. props: {
  41. content: Object
  42. },
  43. data: () => ({
  44. }),
  45. methods: {
  46. ocAsArray (oc) {
  47. // not necesseary anymore (KB #758)
  48. console.log('Array.isArray(oc)', Array.isArray(oc))
  49. return Array.isArray(oc) ? oc : [oc]
  50. }
  51. }
  52. }
  53. </script>
  54. <style lang="scss" scoped>
  55. </style>