2020-06-28 21:23:06 +08:00
|
|
|
import { store } from '@/store/index'
|
2020-06-28 21:29:07 +08:00
|
|
|
// 获取字典方法 使用示例 getDict('sex').then(res) 或者 async函数下 const res = await getDict('sex')
|
2020-06-28 21:23:06 +08:00
|
|
|
export const getDict = async (type) => {
|
|
|
|
await store.dispatch("dictionary/getDictionary", type)
|
|
|
|
return store.getters["dictionary/getDictionary"][type]
|
|
|
|
}
|