最终效果如上图,把首页的路由重定向到mainIndex
代码如下
{
path: "/",
component: Index,//一定要加上这个,不然显示空白页面
redirect: 'mainIndex',//这里是component的名字
children: [
// 下载
{
path: "/download",
component: download
},
// 首页下面
{
path: "/mainIndex",
component: mainIndex,
},
]
},