嵌套路由配置
const routes = [
{
path: '/',
redirect: '/index' //重定向
},
{
path: '/index',
name: 'Home',
component: import('../views/Home.vue'), //路由懒加载
//嵌套路由
children: [
{
path: '/index',
redirect: 'product' //嵌套路由重定向
},
{
path: 'product',
component: import('../views/product.vue')
},
{
path: 'about',
component: import('../views/about.vue')
}
]
}
]