当前位置:   article > 正文

小程序中的navigator 跳转方式_"type: \"navigateto"

"type: \"navigateto"
navigator中的open-type可以决定小程序的跳转方式;
是否关闭当前页面
或者说以何种方式进行跳转
  • 1
  • 2
  • 3
标签<navigator>中 open-type属性表示小程序的跳转方式;
 open-type='redirectTo'
 open-type='navigateTo'
 还有其他的跳转方式
 地址: https://developers.weixin.qq.com/miniprogram/dev/component/navigator.html


 redirectTo:关闭当前页面,跳转到应用内的某个页面。
 但是不允许跳转到 tabbar 页面
 <navigator url="/pages/index/index" open-type='redirectTo'>跳转</navigator>



navigateTo:保留当前页面,跳转到应用内的某个页面。
但是不能跳到 tabbar 页面。
使用 wx.navigateBack 可以返回到原页面。
小程序中页面栈最多十层。(特别重要)
open-type=navigate是它的默认跳转方式是 保留当前页面跳转到另外一个页面


<navigator url="/pages/index/index" open-type='navigateTo'>跳转</navigator>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号