A页面跳转到B页面
A页面:
uni.navigateTo({
url: `B页面路径`,
success: function(res) {
res.eventChannel.emit('自定义',需要传的数据)
}
})
B页面:
onLoad(){
const eventChannel = this.getOpenerEventChannel();
eventChannel.on('hosId', (data) => {
console.log(data)
})
}