后浪云百度小程序教程:swan.offAppShow
- swan.offAppShow
- 方法参数
- 示例
- 图片示例
- 代码示例
swan.offAppShow
基础库 3.60.2 开始支持,低版本需做兼容处理。
解释: 取消监听小程序切前台事件。
方法参数
无
示例
在开发者工具中打开
在开发者工具中打开
在 WEB IDE 中打开
扫码体验
代码示例

请使用百度APP扫码
图片示例

代码示例
- JS
App({onLaunch() {swan.onAppShow(function(res) {console.log('scene', res.scene);console.log('path', res.path);console.log('query', res.query);swan.showModal({title: '',content: '触发swan.onAppShow回调'});});// 在App onLaunch后约3秒取消事件监听(仅做功能示例,开发者可根据业务逻辑选择取消监听时机)setTimeout(() => {swan.offAppShow();swan.showModal({title: '',content: '此后将不会触发swan.onAppShow回调'});}, 3000)}});
版权声明:
作者:后浪云
链接:https://idc.net/help/186783/
文章版权归作者所有,未经允许请勿转载。
THE END
