Fixed #2356 - Carousel autoplay not working with static data
parent
6b3cd1cc8c
commit
ef103e0e34
|
@ -389,12 +389,37 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
let stateChanged = false;
|
||||||
this.createStyle();
|
this.createStyle();
|
||||||
this.calculatePosition();
|
this.calculatePosition();
|
||||||
|
|
||||||
if (this.responsiveOptions) {
|
if (this.responsiveOptions) {
|
||||||
this.bindDocumentListeners();
|
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() {
|
updated() {
|
||||||
const isCircular = this.isCircular();
|
const isCircular = this.isCircular();
|
||||||
|
|
Loading…
Reference in New Issue