Explorar el Código

全局样式优化

zyp hace 1 semana
padre
commit
ea79550450
Se han modificado 1 ficheros con 3 adiciones y 2 borrados
  1. 3 2
      src/layout/components/Sidebar/SidebarItem.vue

+ 3 - 2
src/layout/components/Sidebar/SidebarItem.vue

@@ -73,9 +73,10 @@ export default {
         return true
       }
 
-      // Show parent if there are no child router to display
+      // 扁平路由(完整 path 如 /crm/line)无 children 时须保留 parent.path,
+      // 否则 el-menu-item index 全为空字符串,点击一项会全部高亮
       if (showingChildren.length === 0) {
-        this.onlyOneChild = { ... parent, path: '', noShowingChildren: true }
+        this.onlyOneChild = { ...parent, path: parent.path || '', noShowingChildren: true }
         return true
       }