import {get} from "../../utils/oss";
//方式1:使用let...of
async getList() {
this.invoicesTypeArr = [];
for (let item of arrayList) {
let image_path;
if (item?.image_path) {
image_path = await get(item?.image_path);
}
this.invoicesTypeArr.push({
bill_type: item.bill_type,
image_path: image_path
});
}
}
//方式2:使用Promise.all
async getList2() {
let newList = await Promise.all(
arrayList.map(async item => {
if (item?.image_path) {
item.image_path = item?.image_path;
}
return item;
})
);
}
07-01
1346
12-17
5740
04-02
1万+
03-08
1702
09-06
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交