update MainHeader to display the custom static pages in the burger
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user