1***@qq.com
1***@qq.com
  • 发布:2023-08-07 13:17
  • 更新:2023-08-07 13:25
  • 阅读:261

路由跳转报错一直报错

分类:uni-app

环境:
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,
})
}

2023-08-07 13:17 负责人:无 分享
已邀请:
Diligent_UI

Diligent_UI - 【插件开发】【专治疑难杂症】【多款插件已上架:https://ext.dcloud.net.cn/publisher?id=193663(微信搜索飘逸科技UI小程序直接体验)】【骗子请绕道】问题咨询请加QQ群:120594820,代表作灵感实用工具小程序

看看page.json配置文件里面/pages/apply/index怎么写的

  • 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

要回复问题请先登录注册