在wepy的生命周期onload和onshow使用async
async onLoad (option) {
this.index = option.index
this.$apply()
}
async onShow (option) {
console.log(this.index)
}
在onshow打印的还是旧的值,是不是生命周期使用async后,就会打乱生命周期的运行顺序
在wepy的生命周期onload和onshow使用async
async onLoad (option) {
this.index = option.index
this.$apply()
}
async onShow (option) {
console.log(this.index)
}
在onshow打印的还是旧的值,是不是生命周期使用async后,就会打乱生命周期的运行顺序
7 回答3.4k 阅读✓ 已解决
12 回答5.3k 阅读✓ 已解决
16 回答5.8k 阅读
9 回答3.6k 阅读
7 回答4.1k 阅读✓ 已解决
10 回答3.3k 阅读
6 回答2.3k 阅读✓ 已解决
没有await 为什么要写 async?