当前位置:网站首页>Wechat applet exits the applet (navigator and api--wx.exitminiprogram)
Wechat applet exits the applet (navigator and api--wx.exitminiprogram)
2022-06-26 04:41:00 【Chu Junjun】
demand :
In the wechat applet , Click on “ Cancel ” To exit the applet , Return to the wechat chat interface
effect :

step :
Method 1 :
Use it directly uni-app The components of ——navigator, Modify the parameters open-type="exit" target="miniProgram" that will do
( immediate withdrawal , No other action is required )
<navigator open-type="exit" target="miniProgram" > Cancel </navigator> Method 2 :
Use wechat applet API--wx.exitMiniProgram
( For exit , Clear cache and other operations )
Set click event :
<view @click="exitApplet()"> Cancel </view>Set up api( stay success Function can be written to exit the applet , What to do )
// Exit applet
exitApplet() {
wx.exitMiniProgram({
success: function () {
postCancelLogin({unique_id:this.unique_id}).then((res => {
uni.removeStorageSync('iv'); // Clear cache
uni.removeStorageSync('encryptedData');
}))
}
})
}
边栏推荐
- TP5 distinct method paging problem
- I like you!
- Yapi cross domain request plug-in installation
- Differences between TCP and UDP
- LISP programming language
- Condition query
- Is education important or ability important in software testing
- Advanced learning of MySQL (learning from Shang Silicon Valley teacher Zhou Yang)
- Numpy index and slice
- Install SVN in Pagoda and build SVN version Library
猜你喜欢

Thinkphp6 using kindeditor

1.11 learning summary
![Notes on enterprise wechat development [original]](/img/66/cd83f4f86b7c42921db45f07957c15.jpg)
Notes on enterprise wechat development [original]

2022 talent strategic transformation under the development trend of digital economy

0622-马棕榈跌9%

Yapi cross domain request plug-in installation

PIP batch complete uninstall package

Rdkit chemical formula molecular formula search

Thinkphp6 implements a simple lottery system

2020-12-18
随机推荐
BACK-OFF RESTARTING FAILED CONTAINER 的解决方法
[H5 development] 03- take you hand in hand to improve H5 development - single submission vs batch submission with a common interface
ROS notes (07) - Implementation of client and server
微信小程序保存图片的方法
MySQL index details
Numpy data input / output
numpy 索引及切片
08_ Spingboot integrated redis
Use shell script to analyze system CPU, memory and network throughput
Text horizontal alignment attribute text align and element vertical alignment attribute vertical align
Rsync common error messages (common errors on the window)
Database design (3): database maintenance and optimization
Differences between TCP and UDP
Compiling and installing phpredis extension on MAC
#微信小程序# 在小程序里面退出退出小程序(navigator以及API--wx.exitMiniProgram)
微信小程序保存圖片的方法
1.21 learning summary
Rdkit chemical formula molecular formula search
PHP syntax summary
Nabicat连接:本地Mysql&&云服务Mysql以及报错