Fixed #2356 - Carousel autoplay not working with static data

pull/2835/head
Tuğçe Küçükoğlu 2022-08-10 16:02:33 +03:00
parent 6b3cd1cc8c
commit ef103e0e34
1 changed files with 25 additions and 0 deletions

View File

@ -389,12 +389,37 @@ export default {
}
},
mounted() {
let stateChanged = false;
this.createStyle();
this.calculatePosition();
if (this.responsiveOptions) {
this.bindDocumentListeners();
}
if (this.isCircular()) {
let totalShiftedItems = this.totalShiftedItems;
if (this.d_page === 0) {
totalShiftedItems = -1 * this.d_numVisible;
}
else if (totalShiftedItems === 0) {
totalShiftedItems = -1 * this.value.length;
if (this.remainingItems > 0) {
this.isRemainingItemsAdded = true;
}
}
if (totalShiftedItems !== this.totalShiftedItems) {
this.totalShiftedItems = totalShiftedItems;
stateChanged = true;
}
}
if (!stateChanged && this.isAutoplay()) {
this.startAutoplay();
}
},
updated() {
const isCircular = this.isCircular();