小程序接口 - Channel.on

wmpf.Channel.on(string event, function callback)

监听已注册过的第三方 App 服务事件

参数

Object object

属性 类型 默认值 必填 说明
event string 需要监听的事件名
callback function 回调函数

object.callback 回调函数

参数

Object res

属性 类型 说明
data string 第三方 app 经 wmpf 透传到小程序的数据

示例代码

wmpf.Channel.on('test', (res) => {
  console.log(res.data)
})
posted on 2025-02-24 15:49  AtlasLapetos  阅读(63)  评论(0)    收藏  举报