Mini Program Navigation

I. Introduction

1. The page of the applet is managed by a page stack ,

2. Navigate small program managed by the framework , offers 5a apipage to jump to the page stack.

two,navigateTo

1. Accept a configuration object: (the following are the apisame)

obj={
    
    
	url:'xxx?a=1&b=2' //要跳转的路由,可传递参数
	success:function(res){
    
    }, //成功时的回调函数
	fail:function(res){
    
    }, //失败时的回调函数
	complete:fcuntion(res){
    
    }, //完成时的回调函数。
}

2. Life cycle : the current page onHideis not destroyed, the implementation of the new page onLoad, onShow,onReady

3. Page stack : keep the current page, pusha new page.

three,navigateBack

1. Life cycle : current page onUnload, new page onShow.

2. Page stack : the popcurrent 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 tarbarpage can only be passed switchTaband reLaunchjumped, and parameters cannot be passed by using switchTabjumpurl .

2. Life cycle : First the current page onUnload, and if the current page stack to jump tabberstack pages as well as other pages, those pages will stack onUnload, tabbarp onshow. If the current page is a reLaunchjump, then that is not to jump to a page within the stack tabbarpage, so tabbaryou want to onload, onShow.

3. Page stack : the current page pop, if there is a tabarpage in the current page , and tarbarthere are other pages in the current page and the page, then these pages are all pop. If there is no tarbarpage, then the current page pop, tarbarpage 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.

Guess you like

Origin blog.csdn.net/qq_40340943/article/details/115202393