Browse Source

bug 修复

lilei 3 years ago
parent
commit
7933fa7620
1 changed files with 6 additions and 4 deletions
  1. 6 4
      src/components/MultiTab/MultiTab.vue

+ 6 - 4
src/components/MultiTab/MultiTab.vue

@@ -165,15 +165,17 @@ export default {
         if (na || nb || nc || oa || ob || oc) {
         if (na || nb || nc || oa || ob || oc) {
           // 替换当前页签
           // 替换当前页签
           this.replaceTab(newVal, oldVal)
           this.replaceTab(newVal, oldVal)
+          // 从列表打开新增,编辑
+          this.$store.state.app.isNewTab = na || nb || nc
+          // 从编辑,新增返回列表
+          this.$store.state.app.updateList = ob || oc
         } else {
         } else {
           this.tabsList.push(newVal.name)
           this.tabsList.push(newVal.name)
           this.pages.push(newVal)
           this.pages.push(newVal)
           this.pagesRecordList.push(newVal.name)
           this.pagesRecordList.push(newVal.name)
+          this.$store.state.app.isNewTab = true
+          this.$store.state.app.updateList = false
         }
         }
-        // 从列表打开新增,编辑
-        this.$store.state.app.isNewTab = na || nb || nc
-        // 从编辑,新增返回列表
-        this.$store.state.app.updateList = ob || oc
       } else { // 已存在
       } else { // 已存在
         this.pages.splice(index, 1, newVal)
         this.pages.splice(index, 1, newVal)
         this.tabsList.splice(index, 1, newVal.name)
         this.tabsList.splice(index, 1, newVal.name)