Selaa lähdekoodia

修复刷新回到首页的bug

tongshangming 2 vuotta sitten
vanhempi
commit
2535e83a82
2 muutettua tiedostoa jossa 6 lisäystä ja 7 poistoa
  1. 3 2
      src/components/GlobalMenu.vue
  2. 3 5
      src/components/GlobalTabs.vue

+ 3 - 2
src/components/GlobalMenu.vue

@@ -23,8 +23,9 @@ const menuRouter = computed(() => menuStore.leftMenuList)
 watch(
   menuRouter,
   val => {
-    // generatorMenu(val)
-    val[0] && handleSelect(menuStore.activeRoutePath || val[0].path)
+    if (themeStore.themeNav === 'top') {
+      val[0] && handleSelect(menuStore.activeRoutePath || val[0].path)
+    }
   },
   {
     immediate: true

+ 3 - 5
src/components/GlobalTabs.vue

@@ -82,11 +82,9 @@ const changeTab = (name: TabPaneName) => {
   const menu = tabs.value.find(item => item.fullPath === name)
   router.push(menu)
 
-  if (themeStore.themeNav === 'top') {
-    menuStore.activeRoutePath = name
-    findActiveMenu(name)
-    menuStore.setActiveTopMenu(activeMenu.value)
-  }
+  menuStore.activeRoutePath = name
+  findActiveMenu(name)
+  menuStore.setActiveTopMenu(activeMenu.value)
 }
 const removeTab = (name: TabPaneName) => {
   const index = findActiveIndex(name)