fix: toggle sidebar
This commit is contained in:
@@ -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
@@ -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: {},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user