Browse Source

解决三层菜单问题

yuhan 1 year ago
parent
commit
560c9a9de4
1 changed files with 6 additions and 2 deletions
  1. 6 2
      src/permission.js

+ 6 - 2
src/permission.js

@@ -17,8 +17,12 @@ router.beforeEach((to, from, next) => {
   //解决三级菜单无法缓存问题
   //解决三级菜单无法缓存问题
   //参考: https://blog.csdn.net/qq_37322135/article/details/126013301
   //参考: https://blog.csdn.net/qq_37322135/article/details/126013301
   //参考: https://blog.csdn.net/cwin8951/article/details/106644118
   //参考: https://blog.csdn.net/cwin8951/article/details/106644118
-  if (to.matched && to.matched.length>3) {
-    to.matched.splice(2, to.matched.length - 3)
+  // if (to.matched && to.matched.length>3) {
+  //   to.matched.splice(2, to.matched.length - 3)
+  // }
+  // 修改框架:点击三级菜单的不自动折叠
+  if (to.matched && to.matched.length>4) {
+    to.matched.splice(3, to.matched.length - 4)
   }
   }
   //update-end---author:scott ---date::2022-10-13  for:[jeecg-boot/issues/4091]多级路由缓存问题 #4091--------------
   //update-end---author:scott ---date::2022-10-13  for:[jeecg-boot/issues/4091]多级路由缓存问题 #4091--------------