Answer the question
In order to leave comments, you need to log in
Asynchronous loading of slides does not work in my slider. How to fix?
Good day!
I have a slider with a template
<slider>
<slide>1</slide>
<slide>2</slide>
<slide>3</slide>
</slider>
initSlides() {
this.slides = this.$slots.default.filter((item) => item.componentOptions);
this.slides.forEach((item, index) => {
item.componentOptions.propsData.index = index;
});
}
<slider :itemsToShow="4" :controls="true" :pagination="true" :autoPlay="false">
<slide v-for="(screen, i) in screenshots" :key="'screen' + i">
<img :src="screen" alt="">
</slide>
</slider>
methods: {
initSlides() {
this.slides = this.$slots.default.filter((item) => item.componentOptions);
this.slides.forEach((item, index) => {
item.componentOptions.propsData.index = index;
});
}
},
created() {
this.initSlides();
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question