在router下的index.js文件中
routes: [
{
path: '/',
name: 'HelloWorld',
component: HelloWorld,
redirect: '/Home',
children: [
{
path: '/Home',
name: 'Home',
component: Home,
},
{
path: '/AboutUs',
name: 'AboutUs',
component: AboutUs,
},
}
]
其中home就是需要最开始显示在首页的子组件内容(redirect)