更新记录
1.0.0(2023-08-03)
下载此版本
uniapp可用的Promise.any
平台兼容性
uni-app
Vue2 |
Vue3 |
Chrome |
Safari |
app-vue |
app-nvue |
Android |
iOS |
鸿蒙 |
√ |
√ |
√ |
√ |
√ |
√ |
- |
- |
- |
微信小程序 |
支付宝小程序 |
抖音小程序 |
百度小程序 |
快手小程序 |
京东小程序 |
鸿蒙元服务 |
QQ小程序 |
飞书小程序 |
快应用-华为 |
快应用-联盟 |
√ |
√ |
√ |
√ |
√ |
√ |
- |
√ |
√ |
√ |
√ |
其他
cainiao-PromiseAny
在使用的页面直接引用
// 从自己所放到路径引入
import PromiseAny from '/js_sdk/cainiao-PromiseAny/cainiao-PromiseAny.js'
const ajaxList = [ajax.get(url1), ajax.get(url2), ajax.get(url3)]
// 回调方式
PromiseAny(ajaxList).then(res => {
console.log(res)
}).catch(err => {
console.error(err)
})
// async 同步模式
try{
const res = await PromiseAny(ajaxList)
console.log(res)
}catch(err) {
console.error(err)
}