"tabBar": {
"color": "#40434B",
"selectedColor": "#0077E5",
"backgroundColor": "white",
"borderRadius": "20px",
"height": "55px",
"list": [
{
"pagePath": "pages/home/index",
"iconPath": "static/tab/home.png",
"selectedIconPath": "static/tab/is_home.png",
"text": "首页"
},
{
"pagePath": "pages/list/index",
"iconPath": "static/tab/list.png",
"selectedIconPath": "static/tab/is_list.png",
"text": "列表"
},
{
"pagePath": "pages/shop/index",
"iconPath": "static/tab/shop.png",
"selectedIconPath": "static/tab/is_shop.png",
"text": "商城"
},
{
"pagePath": "pages/message/index",
"iconPath": "static/tab/message.png",
"selectedIconPath": "static/tab/is_message.png",
"text": "消息"
},
{
"pagePath": "pages/my/index",
"iconPath": "static/tab/my.png",
"selectedIconPath": "static/tab/is_my.png",
"text": "我的"
}
]
},
首页是index.vue和index.nvue,在小程序正常,在app中编译首页index.nvue时,首页和其他tabbar页面无法通过tabbar互相切换,只会在第一次成功,后续就不行了,nvue调试器里只有个简单的报错信息

t***@outlook.com
- 发布:2025-05-22 13:25
- 更新:2025-05-22 14:28
- 阅读:16
1 个回复
t***@outlook.com (作者)
解决 ,nvue页面跳转到vue页面时在router.beforeEach((to: any, from, next)中,to和from都是一个地址,没有正确的拿到nvue的url,因为在beforeEach中if (to.path == from.path) {next(false)}的判断,导致无法跳转