总线通信

  • uni.$emit(eventName,OBJECT): Trigger a global custom event
    • 实例: uni.$emit('update',{msg:'页面更新'})
      uni.$on('update',function(data){
      		console.log('监听到事件来自 update ,携带参数 msg 为:' + data.msg);
      	})