export const constantRouterMap = [{ path: '/login’, component: () => import (‘@/views/login/index’), hidden: true }, { path: '/404’, component: () => import (‘@/views/404’), hidden: true },
{
path: '/',
component: Layout,
redirect: '/dashboard',
name: 'Dashboard',
hidden: true,
children: [{
path: 'dashboard',
component: () =>
import ('@/views/dashboard/index')
}]
},
{
path: '/analysis',
component: Layout,
children: [{
path: 'index',
name: '数据分析',
component: () =>
import ('@/views/picc/index'),
meta: { title: '数据分析', icon: 'form', roles: ['admin'] }
}]
}
]
export default new Router({ // mode: 'history’, //后端支持可开 scrollBehavior: () => ({ y: 0 }), routes: constantRouterMap })
export const asyncRouterMap = [{ path: '/nested’, component: Layout, alwaysShow: true, children: [{ path: 'index1’, name: '表格1’, component:resolve => require([‘@/views/nested/menu1/menu1-1/index’],resolve), meta: { title: '表格1’, icon: 'nested’,roles: [‘admin’] } }] }, { path: '*’, redirect: '/404’, hidden: true } ]
上边是router设置,但是侧边栏渲染不出来动态路由啊 侧边只显示一个菜单【数据分析】,显示不出来动态菜单【表格1】。。。。。