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
51
52
53
| //皮肤功能状态
| let MkhUI = {}
| const state = {
| /** 名称 */
| name: '简约',
| /** 编码 */
| code: 'brief',
| /** 主题 */
| theme: 'dark',
| /** 字号 */
| fontSize: 'small',
| }
|
| const getters = {
| fontSize(state) {
| return state.current.fontSize
| },
| }
|
| const mutations = {
| /**
| * @description 初始化
| */
| init(state, { code, theme, fontSize }) {
| let skin = MkhUI.skins.find((m) => m.code === code)
| if (skin) {
| state.name = skin.name
| state.code = skin.code
| state.theme = theme
| state.fontSize = fontSize
| }
| },
| /**
| * @description 皮肤切换
| */
| toggle(state, code) {
| let skin = MkhUI.skins.find((m) => m.code === code)
| if (skin) {
| state.name = skin.name
| state.code = skin.code
| state.theme = skin.theme
| state.fontSize = skin.fontSize
| }
| },
| }
|
| export default {
| namespaced: true,
| state,
| getters,
| mutations,
| modules: {},
| }
|
|