4 回复
zpan
zpan1 楼6 年前
onLoad:function(options){
    let that = this
    然后内容不变,原来所有的this换成that
}
nawei
nawei2 楼6 年前

这是this指向不对的问题。

三个方法。

第一 let that = this 写在你的这个on监听之外。

第二个 写成箭头函数eventChannel.on(‘questions’, (data) => {console.log(this.)})

第三个 看下是否可以 bind(this)

qiang38
qiang383 楼6 年前

传值一直失败,传不了报错this.getOpenerEventChannel is not a function;怎么解决?

odai
odai4 楼4 年前

还是一样的,不知道为什么呢