Library.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <template>
  2. <div class="h-100">
  3. <!-- BACKGROUND (mode) -->
  4. <!-- <component :is="mode" /> -->
  5. <!-- FOREGROUND (texts) -->
  6. <section v-for="group in groups" :key="group.id" class="split-screen">
  7. <text-card :id="group.id" />
  8. <div>
  9. <text-card v-for="id in group.prod" :key="id" :id="id" />
  10. </div>
  11. </section>
  12. </div>
  13. </template>
  14. <script>
  15. import { CardList, CardMap, TreeMap } from './library'
  16. import TextCard from '@/components/text/TextCard'
  17. export default {
  18. name: 'Library',
  19. components: {
  20. // CardList,
  21. // CardMap,
  22. // TreeMap,
  23. TextCard
  24. },
  25. metaInfo () {
  26. return {
  27. title: this.groups.length ? 'Bibliothèque - ' + this.groups[0].id : 'Bibliothèque',
  28. meta: [
  29. { charset: 'utf-8' },
  30. { name: 'viewport', content: 'width=device-width, initial-scale=1' }
  31. ]
  32. }
  33. },
  34. props: {
  35. mode: { type: String, required: true },
  36. texts: { type: Array, required: true }
  37. },
  38. computed: {
  39. groups () {
  40. return this.texts.map(text => {
  41. const [id, ...prod] = text
  42. return { id, prod }
  43. })
  44. }
  45. },
  46. methods: {
  47. openText () {
  48. this.$router.push({
  49. query: {
  50. mode: this.mode,
  51. texts: [...this.texts, [50]]
  52. }
  53. })
  54. }
  55. }
  56. }
  57. </script>
  58. <style lang="scss" scoped>
  59. </style>