TextCard.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template>
  2. <text-card-base v-bind="$attrs">
  3. <template v-slot:header-extra="{ text }">
  4. <b-nav class="ml-auto flex-nowrap" pills>
  5. <template v-if="children">
  6. <b-nav-item
  7. v-for="child in text.children" :key="child.id"
  8. @click="$emit('open', text.id, child.id)"
  9. :active="children.includes(child.id)"
  10. >
  11. {{ child.id }}
  12. </b-nav-item>
  13. </template>
  14. <b-nav-item>
  15. <b-button-close @click="$emit('close', text.id)" />
  16. </b-nav-item>
  17. </b-nav>
  18. </template>
  19. <template v-slot:footer-extra="{ text, toCommaList }">
  20. <b-button
  21. v-if="text.siblings"
  22. :id="'siblings-' + text.id"
  23. >
  24. {{ $t('siblings') }}
  25. </b-button>
  26. <b-popover
  27. v-if="text.siblings"
  28. :target="'siblings-' + text.id" triggers="click" placement="top"
  29. >
  30. <div v-for="sibling in text.siblings" :key="sibling.id">
  31. <h6>
  32. <span>{{ toCommaList(sibling.authors) }},</span>
  33. <span>{{ sibling.title }},</span>
  34. <span>{{ sibling.edition }}</span>
  35. </h6>
  36. </div>
  37. </b-popover>
  38. </template>
  39. </text-card-base>
  40. </template>
  41. <script>
  42. import TextCardBase from './TextCardBase'
  43. export default {
  44. name: 'TextCard',
  45. components: {
  46. TextCardBase
  47. },
  48. props: {
  49. children: { type: Array, default: null }
  50. }
  51. }
  52. </script>
  53. <style lang="scss" scoped>
  54. </style>