Micro-channel applet page jump ~

Common API

wx.navigateTo used to retain the current page, jump to a page within the application, using wx.navigateBack to return to the original page.
When too wx.redirectTo page, the page will be retained squeeze micro-channel memory allocated to the applet, or up to 10 micro-channel layer of the page stack restricted.
wx.reLaunch wx.reLaunch () and wx.redirectTo () uses basically the same, but wx.reLaunch () to turn off the memory of all the pages reserved jump to the target page.
wx.switchTab tab bar to jump to the page, the best choice wx.switchTab (), it will turn off all non-tab bar of page
wx.navigateBack closes the current page, and return to the previous page or multi-stage. Developers can () to get the current page stack, the decision needs to be returned by several layers getCurrentPages.

 

the difference:

(1) wx.navigateTo to retain the current page, jump to a page within the application, using wx.navigateBack to return to the original page. For the page is not a particularly large number of small programs, usually recommended wx.navigateTo jump to return to the original page to load faster. When the page is particularly long time, it is not recommended.

(2) wx.redirectTo When too page, the page will be retained squeeze the micro-channel of the applet memory, or stack of 5 layers of micro channel page restricted. At this point, we should consider selecting wx.redirectTo. wx.redirectTo () closes the current page, jump to a page within the application. This jump, jump to avoid running out of memory occupied by former pages, but return to the page needs to be reloaded, increasing the return to the page display time.

(3) wx.reLaunch wx.reLaunch () and wx.redirectTo () uses basically the same, but wx.reLaunch () to turn off the memory of all the pages reserved jump to the target page.

(4) wx.switchTab tab bar to jump to the page, the best choice wx.switchTab (), it will turn off all non-tab bar of the page. Second, it can be selected wx.reLaunch (), which can be achieved from the non-jump to the tab bar tab bar, or to jump between the tab bar, the same effect wx.switchTab (). API to use other jumps jump to tab bar, it will jump to fail.

(5) wx.navigateBack closes the current page, and return to the previous page or multi-stage. Developers can () to get the current page stack, the decision needs to be returned by several layers getCurrentPages. The API parameters only need to fill delta, it indicates the number of pages to be returned. If delta is greater than the number of pages prior to return, the user returns to the first page into the applet. When the value of the delta is not filled, it will default to 1 (note that the default is not set to 0), i.e., return to the previous page.

 

 

 

 

.

Guess you like

Origin www.cnblogs.com/jianxian/p/11131103.html