async + await 异步
Posted youngman-mrs
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了async + await 异步相关的知识,希望对你有一定的参考价值。
先执行A在执行B再执行.then里面的
AAA() {
XXXXX一堆代码
this.BBB().then(()=>{
其他代码
})
},
async BBB(){
let res = await this.$http({
url:,
data:{
},
})
try{
//执行代码
if (res.body.ifJoinedFamily == ‘0‘) {
} else{
}
}catch(e){
//TODO handle the exception
}
},
以上是关于async + await 异步的主要内容,如果未能解决你的问题,请参考以下文章