gaoluyang
2 小时以前 00ef76a2e286e338fa3c648ce183e3533ce006ad
src/components/TopNav/index.vue
@@ -66,7 +66,10 @@
      if (menu.path === '/' && menu.children) {
          topMenus.push(menu.children[0])
      } else {
          topMenus.push(menu)
        menu.children.forEach(item => {
          topMenus.push(item)
        })
      }
    }
  })
@@ -102,13 +105,13 @@
    const tmpPath = path.substring(1, path.length)
    if (!route.meta.link) {
      activePath = "/" + tmpPath.substring(0, tmpPath.indexOf("/"))
      appStore.toggleSideBarHide(false)
      // appStore.toggleSideBarHide(false)
    }
  } else if(!route.children) {
    activePath = path
    appStore.toggleSideBarHide(true)
    // appStore.toggleSideBarHide(true)
  }
  activeRoutes(activePath)
  // activeRoutes(activePath)
  return activePath
})
@@ -132,11 +135,11 @@
    } else {
      router.push({ path: key })
    }
    appStore.toggleSideBarHide(true)
    // appStore.toggleSideBarHide(true)
  } else {
    // 显示左侧联动菜单
    activeRoutes(key)
    appStore.toggleSideBarHide(false)
    // activeRoutes(key)
    // appStore.toggleSideBarHide(false)
  }
}
@@ -152,7 +155,7 @@
  if(routes.length > 0) {
    permissionStore.setSidebarRouters(routes)
  } else {
    appStore.toggleSideBarHide(true)
    // appStore.toggleSideBarHide(true)
  }
  return routes
}