소스 검색

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: {
   watch: {
     '$route': function (newVal) {
     '$route': function (newVal) {
       this.activeKey = newVal.fullPath
       this.activeKey = newVal.fullPath
+      console.log(this.fullPathList.length)
       if (this.fullPathList.indexOf(newVal.fullPath) < 0) {
       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) {
     activeKey: function (newPathKey) {