123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <template>
- <component-debug :component="this">
- <div class="py-3">
- <b-button @click="openText">
- add text 50
- </b-button>
- </div>
- <component :is="mode" />
- <text-card v-for="group in groups" :key="group.id" :id="group.id" />
- </component-debug>
- </template>
- <script>
- import { CardList, CardMap, TreeMap, TextCard } from './biblio'
- export default {
- name: 'Biblio',
- components: {
- CardList,
- CardMap,
- TreeMap,
- TextCard
- },
- metaInfo () {
- return {
- title: this.groups.length ? 'Bibliothèque - ' + this.groups[0].id : 'Bibliothèque',
- meta: [
- { charset: 'utf-8' },
- { name: 'viewport', content: 'width=device-width, initial-scale=1' }
- ]
- }
- },
- props: {
- mode: { type: String, required: true },
- texts: { type: Array, required: true }
- },
- computed: {
- groups () {
- return this.texts.map(text => {
- const [id, ...prod] = text
- return { id, prod }
- })
- }
- },
- methods: {
- openText () {
- this.$router.push({
- query: {
- mode: this.mode,
- texts: [...this.texts, [50]]
- }
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- </style>
|