update MainHeader to display the custom static pages in the burger

This commit is contained in:
axolotle
2021-10-22 16:42:54 +02:00
parent 51891420d0
commit f53e6c442b
+15 -4
View File
@@ -17,8 +17,11 @@
{{ $t('sections.' + link.to) }}
</b-dropdown-item>
<b-dropdown-item v-for="name in subRoutes" :key="name" :to="{ name }">
{{ $t('sections.' + name) }}
<b-dropdown-item
v-for="page in burger" :key="page.id"
:to="{ name: page.name, params: page.id ? { id: page.id } : {} }"
>
{{ page.id ? page.title : $t('sections.' + page.name ) }}
</b-dropdown-item>
</b-dropdown>
@@ -57,6 +60,9 @@
</template>
<script>
import { mapGetters } from 'vuex'
export default {
name: 'MainHeader',
@@ -66,18 +72,23 @@ export default {
{ to: 'library', variant: 'dark' },
{ to: 'kit', variant: 'kit' },
{ to: 'gallery', variant: 'creation' }
],
subRoutes: ['home', 'introduction', 'contact']
]
}
},
computed: {
...mapGetters(['burger']),
optionsVisible: {
get () { return this.$store.state.optionsVisible },
set (value) {
this.$store.commit('UPDATE_OPTIONS_VISIBILITY', value)
}
}
},
created () {
this.$store.dispatch('GET_BURGER')
}
}
</script>