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
}
},
posted @ 2020-05-19 13:52  就想来看看  阅读(173)  评论(2编辑  收藏  举报