fix Carousel can not trigger on-change event when click the bottom dot

This commit is contained in:
梁灏 2019-12-16 10:24:40 +08:00
parent 253c7010c9
commit 544398501f

View file

@ -269,8 +269,10 @@
},
dotsEvent (event, n) {
let curIndex = this.showCopyTrack ? this.copyTrackIndex : this.trackIndex;
const oldCurrentIndex = this.currentIndex;
if (event === this.trigger && curIndex !== n) {
this.updateTrackIndex(n);
this.$emit('on-change', oldCurrentIndex, this.currentIndex);
this.$emit('input', n);
// Reset autoplay timer when trigger be activated
this.setAutoplay();