vue-admin-template 里边增加动态路由显示不出来侧边菜单啊!!!
发布于 3 年前 作者 chaoren 2275 次浏览 来自 问答
粉丝福利 : 关注VUE中文社区公众号,回复视频领取粉丝福利

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】。。。。。

回到顶部