umbrella22

去除错误的方法

import Cookies from 'js-cookie'
const app = {
state: {
sidebar: {
opened: !+Cookies.get('sidebarStatus'),
opened: !+localStorage.getItem('sidebarStatus'),
withoutAnimation: false
},
device: 'desktop'
......@@ -11,14 +10,14 @@ const app = {
mutations: {
TOGGLE_SIDEBAR: state => {
if (state.sidebar.opened) {
Cookies.set('sidebarStatus', 1)
localStorage.setItem('sidebarStatus', 1)
} else {
Cookies.set('sidebarStatus', 0)
localStorage.setItem('sidebarStatus', 0)
}
state.sidebar.opened = !state.sidebar.opened
},
CLOSE_SIDEBAR: (state, withoutAnimation) => {
Cookies.set('sidebarStatus', 1)
localStorage.setItem('sidebarStatus', 1)
state.sidebar.opened = false
state.sidebar.withoutAnimation = withoutAnimation
},
......