Skip to content

Commit

Permalink
fix:url 中 tab_id 改变而 tab 不切换
Browse files Browse the repository at this point in the history
  • Loading branch information
LLoyou00 committed Jan 23, 2021
1 parent 7b6ddc2 commit f8b6548
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/components/scaffold/tablist.vue
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ export default {
tableHeader: [],
titleGroup: [],
rowActions: [],
activeTabIndex: '0',
selectionAble: false,
options: Object.assign({
form_path: '',
Expand All @@ -149,6 +148,13 @@ export default {
}
},
computed: {
activeTabIndex: function() {
const tabId = this.$route.query.tab_id
const index = this._.findIndex(this.tableTabs, function(o) {
return o.value === tabId
})
return (index > 0 ? index : 0).toString()
},
activeTab: function() {
if (this.$route.query.tab_id) {
return this.$route.query.tab_id
Expand Down Expand Up @@ -179,12 +185,6 @@ export default {
const { tableTabs = [], tableHeader = [], options = {}} = res.payload || {}
if (tableTabs.length > 0) {
this.tableTabs = tableTabs
if (this.$route.query.tab_id) {
const tabId = this.$route.query.tab_id
this.activeTabIndex = this._.findIndex(this.tableTabs, function(o) {
return o.value === tabId
}).toString()
}
}
this.filterRule = res.payload.filterRule || []
this.tableHeader = tableHeader.map(item => ({ ...item, className: this.cellClassName }))
Expand Down

0 comments on commit f8b6548

Please sign in to comment.