vue添加二级路由

vue添加二级路由

1.在router文件夹下的index.js

const routes = [
    {
        path:'/xxx',
        component: () => import('xxx'),
        //添加二级路由
        children:[
         //嵌套的默认路径
            {
               path:''
               component: () => import('xxx'),
               redirect:''
            }, 
            {
                path:'xxx',
                component: () => import('xxx'),
            },
           ...
        ]
    },{}...
]

Guess you like

Origin blog.csdn.net/qq_44255146/article/details/115965038