Page routing
The routing of all pages in the mini program is managed by the framework.
Page stack
The framework maintains all current pages in the form of a stack. When a routing switch occurs, the page stack behaves as follows:
getCurrentPages()
getCurrentPages() Function is used to obtain the instance of the current page stack, which is given in the order of the stack in the form of array. The first element is the homepage and the last element is the current page.
Tip: Do not try to modify the page stack, which will cause routing and page status errors.
Routing method
For routing triggering method and pageLife cycleThe functions are as follows:
Tab switching corresponding life cycle (take pages A and B as Tabbar pages, C is the page opened from page A, and page D is the page opened from page C):
Tips:
navigateTo, redirectTo can only open non-tabBar pages.
switchTab Only the tabBar page can be opened.
reLaunch You can open any page.
The tabBar at the bottom of the page is determined by the page, that is, as long as the page is defined as tabBar, there will be a tabBar at the bottom.
The parameters of the calling page routing can be obtained in onLoad of the target page.
【Related recommendations】
1. Complete source code download of WeChat mini program
2. Chaige WeChat mini program application store source code
3. Simple left swipe operation and waterfall flow layout
The above is the detailed content of Page routing for mini program development. For more information, please follow other related articles on the PHP Chinese website!