The triggering method of routing and the page life cycle function are as follows:
The following are the types of routing methods , Trigger timing
Routing method trigger timing | Pre-routing page | Post-routing page |
---|---|---|
Initialization The first page opened by the applet | ||
onHide | onLoad, onShow | |
onUnload | onLoad, onShow | |
onUnload | onShow | |
Please see the detailed explanation below for usage |
||
Call API wx.reLaunch or use component | onUnload |
Routed page | Triggered life cycle (in order) | |
---|---|---|
A | Nothing happened | |
B | A.onHide(), B.onLoad() , B.onShow() | |
B(open again) | A.onHide(), B.onShow() | |
A | C.onUnload(), A.onShow() | |
B | C.onUnload(), B.onLoad(), B.onShow() | |
B | D.onUnload( ), c.onUnload(), B.onLoad(), B.onShow() | |
A | D .onUnload(), A.onLoad(), A.onShow() | |
B | D.onUnload( ), B.onLoad(), B.onShow() |
, redirectTo
Only non-tabBar pages can be opened.
Only the tabBar page can be opened.
The above is the detailed content of WeChat mini program routing problem. For more information, please follow other related articles on the PHP Chinese website!