浏览代码

bug 修复

lilei 4 年之前
父节点
当前提交
17e2974029
共有 1 个文件被更改,包括 7 次插入2 次删除
  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) {