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