收藏
回答

wx.navigateTo向被打开的页面中传送数据,在ios7中获取不到吗?

微信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



回答关注问题邀请回答
收藏

3 个回答

登录 后发表内容
问题标签