前端utils中封装了前端获取字典并缓存到内存的方法getDict

This commit is contained in:
QM303176530
2020-06-28 21:23:06 +08:00
parent f6c951dd13
commit 30f1ee77e0
9 changed files with 71 additions and 10 deletions

View 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]
}