commit | author | age
|
9bcb19
|
1 |
import Vue from 'vue' |
I |
2 |
import store from '@/store/' |
|
3 |
import { |
|
4 |
ACCESS_TOKEN, |
|
5 |
DEFAULT_COLOR, |
|
6 |
DEFAULT_THEME, |
|
7 |
DEFAULT_LAYOUT_MODE, |
|
8 |
DEFAULT_COLOR_WEAK, |
|
9 |
SIDEBAR_TYPE, |
|
10 |
DEFAULT_FIXED_HEADER, |
|
11 |
DEFAULT_FIXED_HEADER_HIDDEN, |
|
12 |
DEFAULT_FIXED_SIDEMENU, |
|
13 |
DEFAULT_CONTENT_WIDTH_TYPE, |
|
14 |
DEFAULT_MULTI_TAB |
|
15 |
} from '@/store/mutation-types' |
|
16 |
|
|
17 |
import config from '@/config/defaultSettings' |
|
18 |
|
|
19 |
export default function Initializer () { |
|
20 |
store.commit('SET_SIDEBAR_TYPE', Vue.ls.get(SIDEBAR_TYPE, true)) |
|
21 |
store.commit('TOGGLE_THEME', Vue.ls.get(DEFAULT_THEME, config.navTheme)) |
|
22 |
store.commit('TOGGLE_LAYOUT_MODE', Vue.ls.get(DEFAULT_LAYOUT_MODE, config.layout)) |
|
23 |
store.commit('TOGGLE_FIXED_HEADER', Vue.ls.get(DEFAULT_FIXED_HEADER, config.fixedHeader)) |
|
24 |
store.commit('TOGGLE_FIXED_SIDERBAR', Vue.ls.get(DEFAULT_FIXED_SIDEMENU, config.fixSiderbar)) |
|
25 |
store.commit('TOGGLE_CONTENT_WIDTH', Vue.ls.get(DEFAULT_CONTENT_WIDTH_TYPE, config.contentWidth)) |
|
26 |
store.commit('TOGGLE_FIXED_HEADER_HIDDEN', Vue.ls.get(DEFAULT_FIXED_HEADER_HIDDEN, config.autoHideHeader)) |
|
27 |
store.commit('TOGGLE_WEAK', Vue.ls.get(DEFAULT_COLOR_WEAK, config.colorWeak)) |
|
28 |
store.commit('TOGGLE_COLOR', Vue.ls.get(DEFAULT_COLOR, config.primaryColor)) |
|
29 |
store.commit('TOGGLE_MULTI_TAB', Vue.ls.get(DEFAULT_MULTI_TAB, config.multiTab)) |
|
30 |
store.commit('SET_TOKEN', Vue.ls.get(ACCESS_TOKEN)) |
|
31 |
} |