Commit 12cefcf2 authored by 杨奕's avatar 杨奕 Committed by baiyaaaaa

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

parent e6950886
...@@ -143,10 +143,6 @@ export default { ...@@ -143,10 +143,6 @@ export default {
}); });
}, },
handleItemChange: debounce(100, function() {
this.updateItems();
}),
updateItems() { updateItems() {
this.items = this.$children.filter(child => child.$options.name === 'ElCarouselItem'); this.items = this.$children.filter(child => child.$options.name === 'ElCarouselItem');
}, },
...@@ -217,6 +213,7 @@ export default { ...@@ -217,6 +213,7 @@ export default {
}, },
created() { created() {
this.handleItemChange = debounce(100, this.updateItems);
this.throttledArrowClick = throttle(300, true, index => { this.throttledArrowClick = throttle(300, true, index => {
this.setActiveItem(index); this.setActiveItem(index);
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment