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
| const state = {
| info: {},
| list: []
| };
|
| const getters = {
| // 模块信息
| modules: (state: any) => state.info,
| // 模块列表
| moduleList: (state: any) => state.list
| };
|
| const mutations = {
| SET_MODULE(state: any, list: Array<any>) {
| const d: any = {};
|
| list.forEach((e: any) => {
| d[e.name] = e;
| });
|
| state.list = list;
| state.info = d;
| }
| };
|
| export default {
| state,
| getters,
| mutations
| };
|
|