I. Introduction
1. The page of the applet is managed by a page stack ,
2. Navigate small program managed by the framework , offers 5
a api
page to jump to the page stack.
two,navigateTo
1. Accept a configuration object: (the following are the api
same)
obj={
url:'xxx?a=1&b=2' //要跳转的路由,可传递参数
success:function(res){
}, //成功时的回调函数
fail:function(res){
}, //失败时的回调函数
complete:fcuntion(res){
}, //完成时的回调函数。
}
2. Life cycle : the current page onHide
is not destroyed, the implementation of the new page onLoad
, onShow
,onReady
3. Page stack : keep the current page, push
a new page.
three,navigateBack
1. Life cycle : current page onUnload
, new page onShow
.
2. Page stack : the pop
current page.
four,redirectTo
1. life cycle : the current page onUnload
, a new page onload
, onShow
,onReady
2. Page stack : current page pop
, new pagepush
Fives,switchTab
1. The tarbar
page can only be passed switchTab
and reLaunch
jumped, and parameters cannot be passed by using switchTab
jumpurl
.
2. Life cycle : First the current page onUnload
, and if the current page stack to jump tabber
stack pages as well as other pages, those pages will stack onUnload
, tabbar
p onshow
. If the current page is a reLaunch
jump, then that is not to jump to a page within the stack tabbar
page, so tabbar
you want to onload
, onShow
.
3. Page stack : the current page pop
, if there is a tabar
page in the current page , and tarbar
there are other pages in the current page and the page, then these pages are all pop
. If there is no tarbar
page, then the current page pop
, tarbar
page push
.
six,reLanuch
1. life cycle : the current page and other pages that already exists in the stack of pages onUnload
, new page onLoad
, onShow
,onReady
2. Page stack : All pages in the page stack pop
, new pages push
.