auth.js
1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// 设置文件
import setting from '@/setting.js'
export default {
namespaced: true,
state: {
activePage:'',
},
getters: {
/**
* @description 返回当前的主题信息 不是一个名字 而是当前激活主题的所有数据
* @param {Object} state state
*/
activePage (state) {
return state.activePage
}
},
actions: {
/**
* @description 激活一个主题
* @param {String} themeValue 需要激活的主题名称
*/
set ({ state, commit, dispatch }, currentPage) {
return new Promise(async resolve => {
// 检查这个主题在主题列表里是否存在
state.activePage = currentPage
console.log(state.activePage)
// end
resolve()
})
},
/**
* @description 从持久化数据加载主题设置 * @param {Object} context
*/
load ({ state, commit, dispatch }) {
return new Promise(async resolve => {
// end
resolve()
})
}
},
mutations: {
/**
* @description
* @param {Object} state state
*/
dom (state) {
}
}
}