Vue 路由的嵌套

1.配置路由

const routes = [

{
path: '/User',
component: User,
children: [{ path: 'OP1', component: OP1 },//注意子路由的路径写法这里不加/
{ path: 'OP2', component: OP2 }
]
}
 
]

2.父路由里配置子路由显示的地方<router-view></router-view>


原文地址:https://www.cnblogs.com/changedman/p/9223263.html