9
因为我是个Java开发者,对前端技术不太熟悉。我在基础模板的/src/router/index.js中添加了export const asyncRouterMap = []并在其中添加了路由信息,但是无效果,请问还需要添加什么代码,感谢指教一下,谢谢!
export const asyncRouterMap = [
{
path: '/test',
component: Layout,
redirect: '/test/index',
name: 'Test',
meta: {
title: '测试'
},
children: [
{
path: 'index',
component: () => import('@/views/test/index/index'),
name: 'TestIndex',
meta: { title: '测试' }
}
]
},
{ path: '*', redirect: '/404', hidden: true }
]