This commit is contained in:
Pan
2017-06-26 13:38:24 +08:00
commit c528bd8ad0
61 changed files with 3251 additions and 0 deletions

26
src/store/modules/app.js Normal file
View File

@@ -0,0 +1,26 @@
import Cookies from 'js-cookie';
const app = {
state: {
sidebar: {
opened: !+Cookies.get('sidebarStatus')
}
},
mutations: {
TOGGLE_SIDEBAR: state => {
if (state.sidebar.opened) {
Cookies.set('sidebarStatus', 1);
} else {
Cookies.set('sidebarStatus', 0);
}
state.sidebar.opened = !state.sidebar.opened;
}
},
actions: {
ToggleSideBar: ({ commit }) => {
commit('TOGGLE_SIDEBAR')
}
}
};
export default app;