Skip to content

Commit 9804368

Browse files
author
QM303176530
committed
修复菜单参数导致tab栏点击切换出现错误的问题
1 parent fd74cc7 commit 9804368

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

web/src/view/layout/aside/historyComponent/history.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
:key="item.name"
1313
:label="item.meta.title"
1414
:name="item.name"
15+
:tab="item"
1516
v-for="item in historys"
1617
></el-tab-pane>
1718
</el-tabs>
@@ -136,12 +137,15 @@ export default {
136137
const obj = {}
137138
obj.name = route.name
138139
obj.meta = route.meta
140+
obj.query = route.query
141+
obj.params = route.params
139142
this.historys.push(obj)
140143
}
141144
this.activeValue = this.$route.name
142145
},
143-
changeTab(tab) {
144-
this.$router.push({ name: tab.name })
146+
changeTab(component) {
147+
const tab = component.$attrs.tab
148+
this.$router.push({ name: tab.name,query:tab.query,params:tab.params })
145149
},
146150
removeTab(tab) {
147151
const index = this.historys.findIndex(item => item.name == tab)

0 commit comments

Comments
 (0)