mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2026-03-17 19:23:28 +00:00
31 lines
410 B
TypeScript
31 lines
410 B
TypeScript
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
|
|
};
|