vue3版本初版上线 自测已可用
This commit is contained in:
@@ -3,18 +3,18 @@ import { findSysDictionary } from '@/api/sysDictionary'
|
||||
export const dictionary = {
|
||||
namespaced: true,
|
||||
state: {
|
||||
dictionaryMap: {}
|
||||
dictionaryMap: {},
|
||||
},
|
||||
mutations: {
|
||||
setDictionaryMap(state, dictionaryMap) {
|
||||
state.dictionaryMap = { ...state.dictionaryMap, ...dictionaryMap }
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
actions: {
|
||||
// 从后台获取动态路由
|
||||
async getDictionary({ commit, state }, type) {
|
||||
if (state.dictionaryMap[type]) {
|
||||
if (state.dictionaryMap[type] && state.dictionaryMap[type].length) {
|
||||
return state.dictionaryMap[type]
|
||||
} else {
|
||||
const res = await findSysDictionary({ type })
|
||||
|
||||
Reference in New Issue
Block a user