fix: toggle sidebar

This commit is contained in:
Marcin Michałek
2021-08-11 12:43:44 +02:00
parent 1fdafee0a1
commit baf340a65f
2 changed files with 16 additions and 3 deletions
+6 -1
View File
@@ -1,5 +1,5 @@
<template>
<CSidebar position="fixed" selfHiding="md">
<CSidebar position="fixed" selfHiding="md" :class="sidebarClass">
<CSidebarBrand>
<CIcon
customClasses="sidebar-brand-full"
@@ -26,5 +26,10 @@ export default {
components: {
AppSidebarNav,
},
computed: {
sidebarClass () {
return this.$store.state.sidebarClass
}
}
};
</script>
+10 -2
View File
@@ -2,9 +2,17 @@ import { createStore } from "vuex";
export default createStore({
state: {
sidebarShow: true,
sidebarClass: '',
},
mutations: {
toggleSidebar (state) {
if(state.sidebarClass === ''){
state.sidebarClass = 'sidebar-self-hiding-xxl'
}else{
state.sidebarClass = ''
}
}
},
mutations: {},
actions: {},
modules: {},
});