vue如何设置3级路由

平常都是2级路由,也没啥问题,但新增一个3级路由发现页面打不开了

{
    //调查问卷
    path:'/questionnaire',
    component:view,
    children:[
        {
            //我的问卷
            path:'/',
            component: () => import("@/pages/questionnaire/index"),
        },                
        {
            //创建
            path:'add',
            component: () => import("@/pages/questionnaire/add"),
        },                
        {
            //预览
            path:'preview',
            component: () => import("@/pages/questionnaire/preview"),
        },            
        {
            //已回答人数
            path:'people',
            component: () => import("@/pages/questionnaire/people"),
        },
        {
            //选择模板
            path:'/template',
            component:view,
            chidlren:[
                {
                    //选择模板
                    path:'/',
                    component: () => import("@/pages/questionnaire/template"),
                },
                {
                    //创建模板
                    path:'create',
                    component: () => import("@/pages/questionnaire/created"),
                }
            ]
        }    
    ]
}

然后打开路径页面是空白的

clipboard.png

阅读 6.8k
1 个回答

改一下

path:'template',
            component:view,
            chidlren:[
                {
                    //选择模板
                    path:'',
                    component: () => import("@/pages/questionnaire/template"),
                },
                {
                    //创建模板
                    path:'create',
                    component: () => import("@/pages/questionnaire/created"),
                }
            ]
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题