wechathci - 微信小程序navigation跳转问题
本文介绍了wechathci - 微信小程序navigation跳转问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
<view>
<navigator url="../index/index">跳转到新页面</navigator>
<navigator url="../index/index" open-type="redirect">在当前页打开</navigator>
<navigator url="../index/index" open-type="switchTab">切换到首页Tab</navigator>
</view>
只有最后一个 open-type="switchTab"是有效果的,前面两个没效果,求解答。
解决方案
找到问题所在了
navigator 导航的问题 导航分三种
a.open-type="navigate" 打开新界面
b.open-type="redirect" 在本界面中打开新界面
c.open-type="switchTab" 控制tab页之间的切换
注意:
1. 所有需要跳转链接的界面必须在app.json中注册
2. a, b只能连接非tabBar中注册占用的页面,不能打开url="../index/index",因为pages/index/index界面是tab页
3. c只能打开app.json中注册过的tab页,也就是被tabBar注册的界面
这篇关于wechathci - 微信小程序navigation跳转问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文