uniapp exit closes the current applet or APP

Usage scenario: Enter the mini-program/APP with a privacy agreement, click do not agree to the privacy agreement to exit the mini-program/APP

1. Exit the current applet

<navigator open-type="exit" target="miniProgram">退出</navigator>

2. The applet is redirected from the APP, click the button to return to the APP

<button open-type="launchApp" app-parameter="wechat" binderror="launchAppError">退出</button>

navigator

Page jump.
This component is similar to the <a> component in HTML, but it can only jump to local pages. Target pages must be registered in pages.json.

Attributes:

attribute name type Defaults illustrate Explanation of Platform Differences
url String - The jump link in the application, the value is a relative path or an absolute path, such as: ".../first/first", "/pages/first/first", note that the .vue suffix cannot be added -
open-type String navigate Jump method -
delta Number - Valid when the open-type is 'navigateBack', indicating the number of layers to roll back -
animation-type String pop-in/out Valid when the open-type is navigate, navigateBack, the display/close animation effect of the window App
animation-duration Number 300 Valid when the open-type is navigate, navigateBack, the duration of the window display/close animation. App
hover-class String navigator-hover Specify the style class when clicking. When hover-class="none", there is no click state effect -
hover-stop-propagation Boolean false Specify whether to prevent the ancestor nodes of this node from appearing in the click state WeChat applet
hover-start-time Number 50 How long does the click state appear after pressing and holding, in milliseconds -
hover-stay-time Number 600 The click state retention time after the finger is released, in milliseconds -
target String self Which mini-program target to jump to, the default is the current mini-program, and the value field is self/miniProgram WeChat 2.0.7+, Baidu 2.5.2+, QQ

valid values ​​for open-type

value illustrate Explanation of Platform Differences
navigate Corresponds to the function of uni.navigateTo -
redirect Corresponds to the function of uni.redirectTo -
switchTab Corresponds to the function of uni.switchTab -
reLaunch Corresponding to the function of uni.reLaunch The ByteDance applet and Feishu applet do not support
navigateBack Corresponds to the function of uni.navigateBack -
exit Exit the mini program, it will take effect when target="miniProgram" WeChat 2.1.0+, Baidu 2.5.2+, QQ1.4.7+

Official document: https://uniapp.dcloud.net.cn/component/navigator.html#navigator

Guess you like

Origin blog.csdn.net/Kino_Hs/article/details/126866661