zhangqiOMG преди 2 години
родител
ревизия
b3704e4b45
променени са 1 файла, в които са добавени 5 реда и са изтрити 6 реда
  1. 5 6
      src/components/layout/modules/historyTabs.vue

+ 5 - 6
src/components/layout/modules/historyTabs.vue

@@ -35,15 +35,14 @@ const onChange = (val)=>{
   let path = historyRoutes.value.filter(element => element.name == val)
   router.push({name:path[0].name,query:path[0].query,meta:{keepAlive:false}})
 }
-watch(() => router.currentRoute.value,(to, from) => {
-  store.appData(to.meta.name)
+router.beforeEach((to,from,next)=>{
+  let rs = historyRoutes.value.some(item=>item.name == from.name)
+ 
   rotTabs.saveRoute(to)
+  store.appData(to.meta.name)
   activeKey.value = to.name
+  next()
 })
-// router.beforeEach((to,from,next)=>{
-
-//   next()
-// })
 </script>
 <style scoped>
 .sw-tabs{