cool-admin-vue/cool/modules/base/store/module.js
2021-02-28 22:24:54 +08:00

34 lines
484 B
JavaScript

export default {
state: {
info: {},
list: [],
views: []
},
getters: {
// 模块信息
modules: (state) => state.info,
// 模块列表
moduleList: (state) => state.list,
// 模块视图
moduleViews: (state) => state.moduleViews
},
mutations: {
SET_MODULE(state, list) {
let d = {};
list.forEach((e) => {
d[e.name] = e;
});
state.list = list;
state.info = d;
},
SET_MODULE_VIEWS(state, list) {
state.moduleViews = list;
}
}
};