a.wxml
<navigator rul='../bb/bb?title=helloworld' open-type="navigate" hover-class="navigator-hover">
navigate 功能:保留当前页面,跳转到新页面,可以后退返回==》wx.navigateTo()最多达到十层后退
</navigator>
<navigator rul='../cc/cc?title=helloworld' open-type="redirect" hover-class="navigator-hover">
redirect 功能:关闭当前页面,跳转到新页面,不能后退返回==》wx.redirectTo()
</navigator>
<navigator rul='../cc/cc?title=helloworld' open-type="switchTab" hover-class="navigator-hover">
switchTab 功能:关闭所有低部导航页面,跳转到新页面,不能后退返回==》wx.switchTab()
</navigator>
b.ts 接收的逻辑
onLoad: function(options) {
console.log(options)
wx.setNavigationBarTitle({
title:options.title,
});
},
b.wxml
<button type="brimary" bindtap="backBtn">后退到第n层</button>
b.ts
backBtn:function(){
wx.navigateBack({
delta:0, //后退到第n层
})
},
success:function(res){
console.log(res)
},
fail:function(){
},
complet:function(){
}