parent
d3904e6c28
commit
67c06022e1
|
@ -3,7 +3,7 @@ import Cookies from 'js-cookie'
|
||||||
const app = {
|
const app = {
|
||||||
state: {
|
state: {
|
||||||
sidebar: {
|
sidebar: {
|
||||||
opened: !+Cookies.get('sidebarStatus'),
|
opened: Cookies.get('sidebarStatus') ? !!+Cookies.get('sidebarStatus') : true,
|
||||||
withoutAnimation: false
|
withoutAnimation: false
|
||||||
},
|
},
|
||||||
device: 'desktop',
|
device: 'desktop',
|
||||||
|
@ -12,16 +12,16 @@ const app = {
|
||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
TOGGLE_SIDEBAR: state => {
|
TOGGLE_SIDEBAR: state => {
|
||||||
|
state.sidebar.opened = !state.sidebar.opened
|
||||||
|
state.sidebar.withoutAnimation = false
|
||||||
if (state.sidebar.opened) {
|
if (state.sidebar.opened) {
|
||||||
Cookies.set('sidebarStatus', 1)
|
Cookies.set('sidebarStatus', 1)
|
||||||
} else {
|
} else {
|
||||||
Cookies.set('sidebarStatus', 0)
|
Cookies.set('sidebarStatus', 0)
|
||||||
}
|
}
|
||||||
state.sidebar.opened = !state.sidebar.opened
|
|
||||||
state.sidebar.withoutAnimation = false
|
|
||||||
},
|
},
|
||||||
CLOSE_SIDEBAR: (state, withoutAnimation) => {
|
CLOSE_SIDEBAR: (state, withoutAnimation) => {
|
||||||
Cookies.set('sidebarStatus', 1)
|
Cookies.set('sidebarStatus', 0)
|
||||||
state.sidebar.opened = false
|
state.sidebar.opened = false
|
||||||
state.sidebar.withoutAnimation = withoutAnimation
|
state.sidebar.withoutAnimation = withoutAnimation
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue