设置菜单路由时,代码如下: { path: '/materieluse', component: Layout, meta: { title: '仓库管理', icon: 'component' }, children: [{ path: 'materielList', component: () = import('@/views/materieluse/materielList'), name: 'ico
设置菜单路由时,代码如下:
{ path: '/materieluse', component: Layout, meta: { title: '仓库管理', icon: 'component' }, children: [{ path: 'materielList', component: () => import('@/views/materieluse/materielList'), name: 'icons', meta: { title: '请料管理' } }, { path: 'itemDbList', component: () => import('@/views/materieluse/itemDbList'), name: 'icons', meta: { title: '项目仓库' } }] },
面板中的对应标签失效,经查资料,得知:name: "router-name"; //设定路由的名字,一定要填写不然使用<keep-alive>时会出现各种问题,同时noCache: true 设置了也会失效
因此正确代码如下:
{ path: '/materieluse', component: Layout, meta: { title: '仓库管理', icon: 'component' }, children: [{ path: 'materielList', component: () => import('@/views/materieluse/materielList'), name: 'materielList', meta: { title: '请料管理' } }, { path: 'itemDbList', component: () => import('@/views/materieluse/itemDbList'), name: 'itemDbList', meta: { title: '项目仓库' } }] },
以上这篇vue-element-admin 菜单标签失效的解决方式就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持易盾网络。