async a(){
if(){}
else if(){}
else if(){
wx.showModal({
success(res){
if(res.confirm){
await b()
await c()
}
}
})
}
}
b(){}
c(){}
我需要在弹窗按了确认后,执行await操作,请问有什么办法解决这个错误?
Page({
async a() {
if (false) { }
else if (false) { }
else if (true) {
wx.showModal({
success: async (res) => {
if (res.confirm) {
await this.b()
await this.c()
}
}
})
}
},
async b() {
console.log('b');
},
async c() {
console.log('c');
}
})
我看别人是success:function(res){}我也不知道有什么区别你试试罢。话说看看我的问题会不会,折磨一晚上了qaq