天道酬勤,学无止境

自定义事件取消

Development Tips | How to cancel the registration of mPaaS applet custom events?

In the process of developing mPaaS applets, if the existing applet APIs or events cannot meet the development needs, you can also extend it yourself. Mini program calls native custom API1. Client customize API and register.2. Calling the applet. let call = my.call('tinyToNative', { param1: 'p1aaa', param2: 'p2bbb' }, (result) => { console.log(result); my.showToast({ type: 'none', content: result.message, duration: 3000, }); }) So how do we cancel registration? The following code: //取消注册 call.remove(); call = undefined; Native apps send custom events to applets1. Mini Program Registration Event

2021-05-12 17:20:03    分类:博客    自定义事件取消