webview里的wx.miniProgram.navigateTo events
events: {
// 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
acceptDataFromOpenedPage: function(data) {
console.log(data)
if(data == 'success'){
this.$router.push({ path: '/sendRecord' });
}
},
someEvent: function(data) {
console.log(data)
if(data == 'success'){
this.$router.push({ path: '/sendRecord' });
}
}
}
const eventChannel = this.getOpenerEventChannel()
eventChannel.emit('acceptDataFromOpenedPage', {data: 'success'});
eventChannel.emit('someEvent', {data: 'success'});
onLaunch onShow onload 里获取试试。