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) }} {{ $t('sections.' + link.to) }}
</b-dropdown-item> </b-dropdown-item>
<b-dropdown-item v-for="name in subRoutes" :key="name" :to="{ name }"> <b-dropdown-item
{{ $t('sections.' + name) }} 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-item>
</b-dropdown> </b-dropdown>
@@ -57,6 +60,9 @@
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'
export default { export default {
name: 'MainHeader', name: 'MainHeader',
@@ -66,18 +72,23 @@ export default {
{ to: 'library', variant: 'dark' }, { to: 'library', variant: 'dark' },
{ to: 'kit', variant: 'kit' }, { to: 'kit', variant: 'kit' },
{ to: 'gallery', variant: 'creation' } { to: 'gallery', variant: 'creation' }
], ]
subRoutes: ['home', 'introduction', 'contact']
} }
}, },
computed: { computed: {
...mapGetters(['burger']),
optionsVisible: { optionsVisible: {
get () { return this.$store.state.optionsVisible }, get () { return this.$store.state.optionsVisible },
set (value) { set (value) {
this.$store.commit('UPDATE_OPTIONS_VISIBILITY', value) this.$store.commit('UPDATE_OPTIONS_VISIBILITY', value)
} }
} }
},
created () {
this.$store.dispatch('GET_BURGER')
} }
} }
</script> </script>