|
@@ -123,13 +123,19 @@ export default {
|
|
|
watch: {
|
|
|
'$route': function (newVal) {
|
|
|
this.activeKey = newVal.name
|
|
|
- if (this.tabsList.indexOf(newVal.name) < 0) {
|
|
|
+ const index = this.tabsList.indexOf(newVal.name)
|
|
|
+ // 不存在
|
|
|
+ if (index < 0) {
|
|
|
this.tabsList.push(newVal.name)
|
|
|
this.pages.push(newVal)
|
|
|
+ } else {
|
|
|
+ // 已存在
|
|
|
+ this.pages.splice(index, 1, newVal)
|
|
|
}
|
|
|
},
|
|
|
activeKey: function (newPathKey) {
|
|
|
const row = this.pages.find(item => item.name == newPathKey)
|
|
|
+ console.log(row.fullPath)
|
|
|
this.$router.push({ path: row.fullPath })
|
|
|
}
|
|
|
},
|