Explorar o código

隐藏菜单处理

tongshangming %!s(int64=3) %!d(string=hai) anos
pai
achega
23717fcb29
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      src/stores/router.ts

+ 2 - 1
src/stores/router.ts

@@ -45,7 +45,8 @@ function filterAsyncRouter(routerMap: RouteRecordRaw[], role: any[]) {
 }
 
 // 过滤掉hidden为true的路由
-function filterMenuRouter(routerMap: RouteRecordRaw[]) {
+function filterMenuRouter(router: RouteRecordRaw[]) {
+  const routerMap: RouteRecordRaw[] = JSON.parse(JSON.stringify(router))
   const accessedRouters = routerMap.filter(route => {
     if (!route.hidden) {
       if (route.children && route.children.length) {