zhengwei 4 年之前
父节点
当前提交
9c7a843121
共有 2 个文件被更改,包括 7 次插入4 次删除
  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: {
   watch: {
     tableTabs: {
     tableTabs: {
       handler(newName, oldName) {
       handler(newName, oldName) {
-        console.log('handler');
+        console.log('handler', newName, oldName);
         let that = this;
         let that = this;
         that.editableTabs = newName;
         that.editableTabs = newName;
+        that.editableTabsValue = that.editableTabs[that.editableTabs.length];
       },
       },
       deep: true,
       deep: true,
       immediate: true
       immediate: true
@@ -86,6 +87,9 @@ export default {
         this.editableTabs.forEach((tab, index) => {
         this.editableTabs.forEach((tab, index) => {
           if (tab.clmurl == p) {
           if (tab.clmurl == p) {
             this.editableTabs.splice(index, 1);
             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){
       if(notExist){
         this.tableTabs.push(v);
         this.tableTabs.push(v);
       }else{
       }else{
-        console.log(this.editableTabsValue);
-        // this.tableTabs.splice(existIndex,1);
-        // console.log(this.tableTabs[0]);
+        this.tableTabs.splice(existIndex,1);
+        this.tableTabs.push(v);
       }
       }
     },
     },
     //控制显示左侧导航栏
     //控制显示左侧导航栏