|
@@ -122,9 +122,11 @@ export default {
|
|
|
},
|
|
|
watch: {
|
|
|
'$route': function (newVal, oldVal) {
|
|
|
- // 父页面(列表)进入子页面(编辑、详情)再返回至父页面时关闭子页面页签
|
|
|
+ // 父页面(列表)进入子页面(编辑、详情)再返回至父页面时关闭子页面页签 子页面点击“返回列表”
|
|
|
if (oldVal && oldVal.name && newVal.query.closeLastOldTab) {
|
|
|
- this.remove(oldVal.name) // 关闭子页面
|
|
|
+ if (oldVal.name.indexOf('List') == -1) { // 要关闭的页面不能是列表页
|
|
|
+ this.remove(oldVal.name) // 关闭子页面
|
|
|
+ }
|
|
|
}
|
|
|
this.activeKey = newVal.name
|
|
|
const index = this.tabsList.indexOf(newVal.name)
|
|
@@ -139,7 +141,11 @@ export default {
|
|
|
activeKey: function (newPathKey) {
|
|
|
const row = this.pages.find(item => item.name == newPathKey)
|
|
|
// console.log(row.fullPath)
|
|
|
- this.$router.push({ path: row.fullPath })
|
|
|
+ if (row.fullPath.indexOf('/list') == -1) {
|
|
|
+ this.$router.push({ path: row.fullPath })
|
|
|
+ } else {
|
|
|
+ this.$router.push({ path: row.fullPath, query: { closeLastOldTab: true } })
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
render () {
|