Selaa lähdekoodia

菜单bug修改

asd26269546 2 vuotta sitten
vanhempi
commit
3a4186e5d2
1 muutettua tiedostoa jossa 3 lisäystä ja 6 poistoa
  1. 3 6
      src/components/headerBar/header-bar.vue

+ 3 - 6
src/components/headerBar/header-bar.vue

@@ -172,7 +172,6 @@ const routerInit = () => {
 			}
 		}
 	}
-	let num = 0
 	//添加剩余子元素,补齐一列
 	for (let i = 0; i < arr.length; i++) {
 		const element = arr[i]
@@ -181,19 +180,17 @@ const routerInit = () => {
 			if (
 				element.children &&
 				element.children.length > 0 &&
-				(num % 11) + element.children.length + 1 > 11 &&
+				((i) % 11) + element.children.length + 1 > 11 &&
 				element.children.length < 11
 			) {
-				
-				for (let j = 0; j < 11 - (num % 11); j++) {
+				let num = 11 - ((i) % 11)
+				for (let j = 0; j < num; j++) {
 					arr.splice(i, 0, { ...element, isNone: true })
 					i++
 				}
-				num++
 			}
 			
 		}
-		num++
 	}
 	sidebarRouters.value = arr
 }