关于vue.js:vue-中使用-Promiseall

4次阅读

共计 201 个字符,预计需要花费 1 分钟才能阅读完成。

import {fun1,fun2,} from "@/api/seting.js";
从 api 中引到页面中的办法
fun1(),fun2()
let c = 200 // 申请传的参数
let a = fun1(c)
let b = fun2(c)

Promise.all([a, b]).then((res) => {console.log(res)       //  申请回来的是一个数组
}).catch((err) => {console.log(err)
})
正文完
 0