Parcourir la source

header文件修改

wuhongbo il y a 1 an
Parent
commit
62e2672435
1 fichiers modifiés avec 5 ajouts et 1 suppressions
  1. 5 1
      client/src/views/OaSystem/oaLayout/header.vue

+ 5 - 1
client/src/views/OaSystem/oaLayout/header.vue

@@ -111,8 +111,10 @@ const initMenus = async () => {
 }
 
 const childFun = async (name: any, arr: any) => {
+  console.log(name, arr)
+  reactiveData.routes = []
   for (let i = 0; i < arr.length; i++) {
-    if (arr[i].children != null) {
+    if (arr[i].children != null && arr[i].children) {
       for (let j = 0; j < arr[i].children.length; j++) {
         if (arr[i].children[j].path == name) {
           headerTitleName.value = arr[i].name
@@ -125,6 +127,8 @@ const childFun = async (name: any, arr: any) => {
       }
     }
   }
+
+  console.log(reactiveData.routes)
 }
 watch(() => {
   initMenus()