Difference wx.navigateTo, wx.redirectTo, wx.reLaunch, wx.switchTab and the wx.navigateBack

wx.navigateTo, wx.redirectTo, wx.reLaunch, wx.switchTab and wx.navigateBack What difference does it make?

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.

wx.redirectTo:

When too many pages, 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 time you should consider choosing 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.

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:

For the 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.

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.

> This article from the wooden village network blog > difference wx.navigateTo, wx.redirectTo, wx.reLaunch, wx.switchTab and the wx.navigateBack

Guess you like

Origin www.cnblogs.com/muzhuang/p/11696349.html