Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize page jump in WeChat Mini Programs

2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

Most people do not understand the knowledge points of this "how to achieve page jump in WeChat Mini Programs" article, so the editor summarizes the following content, detailed content, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "how to achieve page jump in WeChat Mini Programs" article.

The reasons for WeChat Mini Programs's page jump failure may be: 1: check whether the address you jump to is wrong; 2: check whether the address you want to jump to has been registered in app.js; 3: when the address you jump to is in TabBar, use wx.switchTab to jump to the page.

Next, let's summarize the methods of jumping:

1.API Jump

Wx.navigateTo ({...})

Wx.redirectTo ({...})

Wx.switchTab ({...})

Wx.reLanch ({...})

(1) wx.navigateTo ({...})

Instead of destroying the current page, just hide it. You can return to the original page using wx.navigateBack.

Note: when a navigateTo jump is called, the page that calls this method will be added to the stack

/ / close the current page and return to the previous page or multi-level page. You can get the current page stack through getCurrentPages () and decide how many layers you need to return. Wx.navigateTo ({url: 'page/home/home' / / Page A}) wx.navigateTo ({url:' page/detail/detail' / / Page B}) / / Jump to Page Awx.navigateBack ({delta: 2})

(2) wx.redirectTo ({...})

Close the current page and jump to a corresponding page within the application

(3) wx.switchTab ({...})

Jump to the tabBar page (the tabBar page registered in app.json), and colleagues close other non-tabBar pages

(4) wx.reLanch ({...})

Close all pages and open to a page within the application.

2.wxml Page component Jump ()

/ / the default open-type of the navigator component is navigate to jump to the new page / / the wx.redirect method in the corresponding API opens in the current page / / switchTab the wx.switchTab method in the corresponding API toggles the Tab// reLanch corresponding to the wx.reLanch method in the API closes all pages, opens to a page in the application / / navigateBack corresponding to the wx.navigateBack method in the API to close the current page Returning to the page above or above is the content of this article on "how to achieve page jump in WeChat Mini Programs". I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report