微信小程序---关闭

微信小程序官方并没有提供退出的api。

但是提供了navigator这个组件

使用方法:
<navigator open-type=“exit” target=“miniProgram”>关闭按钮</navigator>

组件api:
https://developers.weixin.qq.com/miniprogram/dev/component/navigator.html

navigator中有一个属性open-type,这个是设置跳转方式的。我们看下open-type有哪些值
小程序

可以看到最后一个值。当设置open-type设置为exit时,必须要设置为target=’miniProgram’。注意: 这个是小程序版本库2.1.0之后才有的功能,所以要经常关注微信小程序文档更新

微信小程序

TAG标签: 微信小程序如何关闭微信小程序

http://www.xiaochengxub.com/read-103904.html