Explorar el Código

fix: multi-tabs close the last tab content redraw. #94

Sendya hace 6 años
padre
commit
03d12334b6
Se han modificado 1 ficheros con 2 adiciones y 3 borrados
  1. 2 3
      src/components/MultiTab/MultiTab.vue

+ 2 - 3
src/components/MultiTab/MultiTab.vue

@@ -33,11 +33,10 @@ export default {
       this[action](targetKey)
     },
     remove (targetKey) {
-      if (this.pages.length === 1) {
-        return
-      }
       this.pages = this.pages.filter(page => page.fullPath !== targetKey)
       this.fullPathList = this.fullPathList.filter(path => path !== targetKey)
+      // 跳转到最后一个还存在的标签页
+      this.activeKey = this.fullPathList[this.fullPathList.length - 1]
     }
   },
   watch: {