微信小程序 navigator遇到的情况

试听申请
  • 这是代码情况,因为ff 与navigator 在同一个pages页面下,所以不能跳转,但把open-type改成switchTab后,就可以实现在tabBar跳转,后来查阅了资料,得出一下结论:
  • navigator的open-type属性 可选值 'navigate'、'redirect'、'switchTab',对应于wx.navigateTo、wx.redirectTo、wx.switchTab的功能

    open-type="navigate"等价于API的 wx.navigateTo 而wx.navigateTo的url是需要跳转的应用内非 tabBar 的页面的路径

    open-type="redirect"等价于API的 wx.redirectTo 而wx.redirectTo的url是需要跳转的应用内非 tabBar 的页面的路径

    open-type="switchTab"等价于API的 wx.switchTab而wx.switchTab的url是需要跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面

    最后一个switchTab事件触发以后 把前面的页面都关闭了

     

 

 

你可能感兴趣的:(微信小程序 navigator遇到的情况)