Przeglądaj źródła

Carousel: fix interval and scale bug (#20931)

好多大米 4 lat temu
rodzic
commit
655d89fe0e
2 zmienionych plików z 6 dodań i 0 usunięć
  1. 1 0
      packages/carousel/src/item.vue
  2. 5 0
      packages/carousel/src/main.vue

+ 1 - 0
packages/carousel/src/item.vue

@@ -98,6 +98,7 @@
           this.active = index === activeIndex;
           const isVertical = parentDirection === 'vertical';
           this.translate = this.calcTranslate(index, activeIndex, isVertical);
+          this.scale = 1;
         }
         this.ready = true;
       },

+ 5 - 0
packages/carousel/src/main.vue

@@ -159,6 +159,11 @@ export default {
 
     loop() {
       this.setActiveItem(this.activeIndex);
+    },
+
+    interval() {
+      this.pauseTimer();
+      this.startTimer();
     }
   },