[PanJiaChen/vue-admin-template]动态权限和动态侧边栏

2024-03-07 453 views
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 }
]

回答

7

什么叫无效果

4

就是侧边栏看不到 image

0

好的,感谢!