Explorar o código

Carousel: fix item change handler blocked by debounce with multiple instances (#3380)

杨奕 %!s(int64=8) %!d(string=hai) anos
pai
achega
12cefcf26a
Modificáronse 1 ficheiros con 1 adicións e 4 borrados
  1. 1 4
      packages/carousel/src/main.vue

+ 1 - 4
packages/carousel/src/main.vue

@@ -143,10 +143,6 @@ export default {
       });
     },
 
-    handleItemChange: debounce(100, function() {
-      this.updateItems();
-    }),
-
     updateItems() {
       this.items = this.$children.filter(child => child.$options.name === 'ElCarouselItem');
     },
@@ -217,6 +213,7 @@ export default {
   },
 
   created() {
+    this.handleItemChange = debounce(100, this.updateItems);
     this.throttledArrowClick = throttle(300, true, index => {
       this.setActiveItem(index);
     });