search
HomeWeChat AppletMini Program DevelopmentHow to implement page jump in mini program

How to implement page jump in mini program

Aug 31, 2020 am 10:51 AM
AppletsPage jump

How to implement page jump in the mini program: 1. Use navigation components, labels, and page links to achieve it; 2. Add listening to the bindtap event to the page layout, and use [wx.navigatorTo] in the method to achieve it. Realize the jump; 3. Realize the jump through [wx.redirectTo].

How to implement page jump in mini program

[Related learning recommendations: 小program development

How to implement page jump in mini program:

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

<!-- sample.wxml -->
<view class="btn-area">
 <navigator url="../my/my">跳转到新页面</navigator>
</view>

Parameters As follows

How to implement page jump in mini program

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 within the For a certain page, use wx.navigateBack to return to the original page)

Add monitoring bindtap event in my.wxml

<view bindtap=&#39;jump&#39;>跳转</view>

Realize jump in my.js

jump:function(){
  wx.navigateTo({
   url: &#39;../login/login&#39;,
   success: function(res) {
 
   },
   fail: function(res) {
 
   },
   complete: function(res) {
 
   },
  })
 }

The parameters are as follows

How to implement page jump in mini program

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

navigateto_index: function (event) { 
 wx.redirectTo({ 
 url: &#39;../index/index&#39;, 
 success: function (res) { 
 // success 
 }, 
 fail: function () { 
 // fail 
 }, 
 complete: function () { 
 // complete 
 } 
 }) 
 
 }

The parameters are as follows

How to implement page jump in mini program

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

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

How to implement page jump in mini program

Related learning recommendations: WeChat public account development tutorial

The above is the detailed content of How to implement page jump in mini program. For more information, please follow other related articles on the PHP Chinese website!

Statement
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools