前端utils中封装了前端获取字典并缓存到内存的方法getDict
This commit is contained in:
6
web/src/utils/dictionary.js
Normal file
6
web/src/utils/dictionary.js
Normal file
@@ -0,0 +1,6 @@
|
||||
import { store } from '@/store/index'
|
||||
|
||||
export const getDict = async (type) => {
|
||||
await store.dispatch("dictionary/getDictionary", type)
|
||||
return store.getters["dictionary/getDictionary"][type]
|
||||
}
|
Reference in New Issue
Block a user