How to implement jump in WeChat applet? (Method introduction)

青灯夜游
Release: 2020-04-15 09:30:32
forward
4449 people have browsed it

How to implement jump in WeChat applet? The following article will summarize for you several ways to implement jumps in WeChat mini programs. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.

How to implement jump in WeChat applet? (Method introduction)

#1. Use navigation components, labels, and page links to achieve this (you can find that there is a background when clicking)

  跳转到新页面 
Copy after login

The parameters are as follows

How to implement jump in WeChat applet? (Method introduction)

#2. Add a listener for the bindtap event to the page layout, and then in the method, use wx.navigatorTo to implement the jump (retain the current page and jump to the application A certain page within the page, use wx.navigateBack to return to the original page)

Add monitoring bindtap event in my.wxml

跳转
Copy after login

Realize jump in my.js

jump:function(){ wx.navigateTo({ url: '../login/login', success: function(res) { }, fail: function(res) { }, complete: function(res) { }, }) }
Copy after login

The parameters are as follows

How to implement jump in WeChat applet? (Method introduction)

3. Jump through wx.redirectTo (close the current page and jump to a page in the application)

navigateto_index: function (event) { wx.redirectTo({ url: '../index/index', success: function (res) { // success }, fail: function () { // fail }, complete: function () { // complete } }) }
Copy after login

The parameters are as follows

How to implement jump in WeChat applet? (Method introduction)

#4. Return to the previous level through wx.navigateBack (close the current page. Return to the previous page or more level page).

wx.navigateBack({ delta: 1, // 回退前 delta(默认为1) 页面 success: function (res) { // success }, fail: function () { // fail }, complete: function () { // complete } })
Copy after login

How to implement jump in WeChat applet? (Method introduction)

Recommended: "小program Development Tutorial"

The above is the detailed content of How to implement jump in WeChat applet? (Method introduction). For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!