A页面
"方法名": function(){
uni.$emit('update',{msg:'页面更新'})
}
B页面
onShow: function () {
uni.$on('update',function(data){
console.log('监听到事件来自 update ,携带参数 msg 为:' + data.msg);
});
}
A页面
"方法名": function(){
uni.$emit('update',{msg:'页面更新'})
}
B页面
onShow: function () {
uni.$on('update',function(data){
console.log('监听到事件来自 update ,携带参数 msg 为:' + data.msg);
});
}