提交 b8a36d05 作者: 方治民

fix: 修复顶级 await

上级 888440d5
......@@ -2,6 +2,7 @@ import { cascaderHn } from '/@/api/model/dict'
const storageKey = 'app_dict_data_area_cascaderHn';
let areaOptions = [];
export const getDictData = async () => {
// 先从本地加载数据
let dictData = getLocalDict();
......@@ -12,6 +13,8 @@ export const getDictData = async () => {
uni.setStorageSync(storageKey, data);
dictData = JSON.parse(data);
}
areaOptions = dictData;
return dictData;
}
......@@ -36,8 +39,6 @@ export const refreshDictData = () => {
getDictData();
}
const areaOptions = await getDictData();
export const getText = (scope: string, spliced: string) => {
if (!scope || !areaOptions || areaOptions.length === 0) {
return ''
......@@ -72,4 +73,4 @@ export const getText = (scope: string, spliced: string) => {
} else {
return labels ? labels.join('') : ''
}
}
\ No newline at end of file
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论