cool-admin-vue/cool/components/base/store/component.js
2021-02-28 01:55:04 +08:00

34 lines
497 B
JavaScript

export default {
state: {
info: {},
list: [],
modules: []
},
getters: {
// 组件信息
components: (state) => state.info,
// 组件列表
componentList: (state) => state.list,
// 组件模块
componentModules: (state) => state.modules
},
mutations: {
SET_COMPONENT(state, list) {
let d = {};
list.forEach((e) => {
d[e.name] = e;
});
state.list = list;
state.info = d;
},
SET_COMPONENT_MODULES(state, list) {
state.modules = list;
}
}
};