微信WeChat: version:7.0.10
调试基础库:2.8.3
API接口:wxnavigateTo
wx.navigateTo({
url: '/pages/views/business/data/supplier/editSupplier/editSupplier',
success: function (res) {
// 通过eventChannel向被打开页面传送数据
res.eventChannel.emit('edit', {
title: '修改',
id: id,
})
}
});
被打开的页面
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let that = this;
const eventChannel = this.getOpenerEventChannel();
eventChannel.on('edit', function (data) {
console.log(data)
});
},
报错信息
this.getOpenerEventChannel is not a function;at "pages/views/business/data/supplier/editSupplier/editSupplier" page lifeCycleMethod onLoad function
TypeError: this.getOpenerEventChannel is not a function
麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html