dictionary.js 315 B

123456
  1. import { store } from '@/store/index'
  2. // 获取字典方法 使用示例 getDict('sex').then(res) 或者 async函数下 const res = await getDict('sex')
  3. export const getDict = async (type) => {
  4. await store.dispatch("dictionary/getDictionary", type)
  5. return store.getters["dictionary/getDictionary"][type]
  6. }