Преглед на файлове

修复菜单参数导致tab栏点击切换出现错误的问题

QM303176530 преди 4 години
родител
ревизия
fe326bd942
променени са 1 файла, в които са добавени 6 реда и са изтрити 2 реда
  1. 6 2
      web/src/view/layout/aside/historyComponent/history.vue

+ 6 - 2
web/src/view/layout/aside/historyComponent/history.vue

@@ -12,6 +12,7 @@
         :key="item.name"
         :label="item.meta.title"
         :name="item.name"
+        :tab="item"
         v-for="item in historys"
       ></el-tab-pane>
     </el-tabs>
@@ -136,12 +137,15 @@ export default {
         const obj = {}
         obj.name = route.name
         obj.meta = route.meta
+        obj.query = route.query
+        obj.params = route.params
         this.historys.push(obj)
       }
       this.activeValue = this.$route.name
     },
-    changeTab(tab) {
-      this.$router.push({ name: tab.name })
+    changeTab(component) {
+      const tab = component.$attrs.tab
+      this.$router.push({ name: tab.name,query:tab.query,params:tab.params })
     },
     removeTab(tab) {
       const index = this.historys.findIndex(item => item.name == tab)