zhengwei 4 năm trước cách đây
mục cha
commit
9c7a843121
2 tập tin đã thay đổi với 7 bổ sung4 xóa
  1. 5 1
      src/components/Headside.vue
  2. 2 3
      src/views/Index/Index.vue

+ 5 - 1
src/components/Headside.vue

@@ -54,9 +54,10 @@ export default {
   watch: {
     tableTabs: {
       handler(newName, oldName) {
-        console.log('handler');
+        console.log('handler', newName, oldName);
         let that = this;
         that.editableTabs = newName;
+        that.editableTabsValue = that.editableTabs[that.editableTabs.length];
       },
       deep: true,
       immediate: true
@@ -86,6 +87,9 @@ export default {
         this.editableTabs.forEach((tab, index) => {
           if (tab.clmurl == p) {
             this.editableTabs.splice(index, 1);
+            this.$router.push({
+              path: this.editableTabs[this.editableTabs.length - 1].clmurl
+            })
           }
         });
       }

+ 2 - 3
src/views/Index/Index.vue

@@ -64,9 +64,8 @@ export default {
       if(notExist){
         this.tableTabs.push(v);
       }else{
-        console.log(this.editableTabsValue);
-        // this.tableTabs.splice(existIndex,1);
-        // console.log(this.tableTabs[0]);
+        this.tableTabs.splice(existIndex,1);
+        this.tableTabs.push(v);
       }
     },
     //控制显示左侧导航栏