为什么都没了
This commit is contained in:
15
framework/Web/public/doc-code/api/queue.js
Normal file
15
framework/Web/public/doc-code/api/queue.js
Normal file
@@ -0,0 +1,15 @@
|
||||
/* 使用关键字await */
|
||||
async function doc() {
|
||||
const res1 = await this.$api.apiName1(params1)
|
||||
const res2 = await this.$api.apiName2(params2)
|
||||
}
|
||||
|
||||
/* 使用$queue */
|
||||
this.$api
|
||||
.$queue([
|
||||
this.$api.apiName1Await(params1),
|
||||
this.$api.apiName2Await(params2),
|
||||
])
|
||||
.then(([_res1, _res2]) => {
|
||||
/* ... */
|
||||
})
|
||||
Reference in New Issue
Block a user