vue3访问嵌套路由报错[Vue Router warn]: No match found for location with path

访问嵌套路由报错 No match found for location with path
解决方法:子路由的path 不要斜杠/
path:’/keyBusinessIndex’ 改成 path:‘keyBusinessIndex’


 {
    
    
        path: '/keyBusiness', //关键业务
        component: keyBusiness,
        children: [
            {
    
    
                path:'/keyBusinessIndex',
                component:keyBusinessIndex,
                meta: {
    
    
                    title: '关键业务'
                },
            }
        ]
    },

改成

 {
    
    
        path: '/keyBusiness', //关键业务
        component: keyBusiness,
        children: [
            {
    
    
                path:'keyBusinessIndex',
                component:keyBusinessIndex,
                meta: {
    
    
                    title: '关键业务'
                },
            }
        ]
    },

猜你喜欢

转载自blog.csdn.net/weixin_42821697/article/details/122382168