uniapp 同一个页面用了 uni.on , uni.$off , uni.$emit 失效
·
// 在onReady生命周期里面使用uni.$on , onunload 生命周期里面使用uni.$off, uni.$emit在具体的事件里面使用
onReady() {
uni.$on('selAddressInfor',(res)=>{
this.dataForm.coordinate = res.longitude + ',' + res.latitude
this.dataForm.address = res.address
this.locationAddress = res.address
})
},
onunload(){
uni.$off('selAddressInfor')
},
更多推荐



所有评论(0)