如果想infoDetail页面中传递参数,方法如下:
uni.navigateTo({ url: `/pages/views/infoDetail`, success: res => { res.eventChannel.emit('redactInfo',{info:info}) }, fail: () => {}, complete: () => {} });
infoDetail需要在onLoad中:
onLoad(e) {//修改信息时,反填信息 const eventChannel = that.getOpenerEventChannel(); // 监听redactInfo事件,获取上一页面通过eventChannel传送到当前页面的数据 eventChannel.on('redactInfo', function(data) { console.log("获取到信息", data.info) }); }