export default new Router({
routes: [
{
path: '/',
name: 'index',
component: index,
children: [
{
path: '/demo',
name: 'demo',
component: HelloWorld,
meta: {
requireAuth: true
}
},
{
path: '/demo1',
name: 'demo1',
component: HelloWorld1,
},
],
redirect: "/demo" //这段代码
},
]
})