|
|
@ -2,7 +2,7 @@ import Cookies from 'js-cookie'
|
|
|
|
|
|
|
|
|
|
|
|
const state = {
|
|
|
|
const state = {
|
|
|
|
sidebar: {
|
|
|
|
sidebar: {
|
|
|
|
opened: Cookies.get('sidebarStatus') ? !!+Cookies.get('sidebarStatus') : true,
|
|
|
|
opened:true,
|
|
|
|
withoutAnimation: false,
|
|
|
|
withoutAnimation: false,
|
|
|
|
hide: false
|
|
|
|
hide: false
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -15,7 +15,7 @@ const mutations = {
|
|
|
|
if (state.sidebar.hide) {
|
|
|
|
if (state.sidebar.hide) {
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
state.sidebar.opened = !state.sidebar.opened
|
|
|
|
state.sidebar.opened = true
|
|
|
|
state.sidebar.withoutAnimation = false
|
|
|
|
state.sidebar.withoutAnimation = false
|
|
|
|
if (state.sidebar.opened) {
|
|
|
|
if (state.sidebar.opened) {
|
|
|
|
Cookies.set('sidebarStatus', 1)
|
|
|
|
Cookies.set('sidebarStatus', 1)
|
|
|
@ -25,7 +25,7 @@ const mutations = {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
CLOSE_SIDEBAR: (state, withoutAnimation) => {
|
|
|
|
CLOSE_SIDEBAR: (state, withoutAnimation) => {
|
|
|
|
Cookies.set('sidebarStatus', 0)
|
|
|
|
Cookies.set('sidebarStatus', 0)
|
|
|
|
state.sidebar.opened = false
|
|
|
|
state.sidebar.opened = true
|
|
|
|
state.sidebar.withoutAnimation = withoutAnimation
|
|
|
|
state.sidebar.withoutAnimation = withoutAnimation
|
|
|
|
},
|
|
|
|
},
|
|
|
|
TOGGLE_DEVICE: (state, device) => {
|
|
|
|
TOGGLE_DEVICE: (state, device) => {
|
|
|
@ -36,7 +36,7 @@ const mutations = {
|
|
|
|
Cookies.set('size', size)
|
|
|
|
Cookies.set('size', size)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
SET_SIDEBAR_HIDE: (state, status) => {
|
|
|
|
SET_SIDEBAR_HIDE: (state, status) => {
|
|
|
|
state.sidebar.hide = status
|
|
|
|
state.sidebar.hide = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|