环境:
h5
报错信息:
"navigateTo:fail Navigation cancelled from "/pages/apply/index" to "/" with a new navigation."
代码:
const tabbar_menu = ref([
{
id: 1,
name: '首页',
icon: 'IconHome',
path: '/pages/index/index',
},
{
id: 2,
name: '应用',
icon: 'IconMine',
path: '/pages/apply/index',
},
{
id: 3,
name: '我的',
icon: 'IconMyself',
path: '/pages/my/index',
},
])
// 点击 tabbar 值改变后回调
function tabbarCursorChange(item) {
tabbarCursor.value = item.id
uni.navigateTo({
url: item.path,
})
}
1***@qq.com (作者)
好的嘞
"pages": [
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "首页"
}
},
{
"path": "pages/login/index",
"style": {
"navigationBarTitleText": "登录"
}
},
{
"path": "pages/apply/index",
"style": {
"navigationBarTitleText": "应用"
}
},
{
"path": "pages/my/index",
"style": {
"navigationBarTitleText": "个人中心"
}
}
],
2023-08-07 13:26
1***@qq.com (作者)
好像知道了,我前面还有交互没做完,包一层setTimeout就可以了
2023-08-07 14:46