lilei 4 yıl önce
ebeveyn
işleme
17e2974029
1 değiştirilmiş dosya ile 7 ekleme ve 2 silme
  1. 7 2
      src/components/MultiTab/MultiTab.vue

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

@@ -122,9 +122,14 @@ export default {
   watch: {
     '$route': function (newVal) {
       this.activeKey = newVal.fullPath
+      console.log(this.fullPathList.length)
       if (this.fullPathList.indexOf(newVal.fullPath) < 0) {
-        this.fullPathList.push(newVal.fullPath)
-        this.pages.push(newVal)
+        if (this.fullPathList.length <= 10) {
+          this.fullPathList.push(newVal.fullPath)
+          this.pages.push(newVal)
+        } else {
+          this.$message.info('最多同时打开10个页签')
+        }
       }
     },
     activeKey: function (newPathKey) {