nuxt-swiper icon indicating copy to clipboard operation
nuxt-swiper copied to clipboard

SwiperEffectCoverflow - swiperSlideOffset: NaN in slides

Open mobius77 opened this issue 1 year ago • 0 comments

I'm trying use SwiperEffectCoverflow module, but there is no effect.

<Swiper
              :modules="[SwiperEffectCoverflow]"
              id="daySwiper"
              :direction="'vertical'"
              :effect="'coverflow'"
              :coverflowEffect="{
                rotate: -35,
                stretch: -5,
                depth: 105,
                scale: 1,
                modifier: 1,
                slideShadows: false,
              }"
              :slides-per-view="'5'"
              :centeredSlides="true"
              :grabCursor="true"
              class="mySwiper"
            >
              <SwiperSlide  v-for="day in days" :key="day.index" >{{day}}</SwiperSlide>
 </Swiper>

It's because: swiperSlideOffset: NaN in slides.... in file effect-coverflow.mjs in loop: for (let i = 0, length = slides.length; i < length; i += 1) {

I don't understand why

If i change: const slideOffset = slideEl.swiperSlideOffset; to: const slideOffset = slideEl.swiperSlideIndex * slideSize;

everything works fine...

This problem only occurs if the slider is hidden when the page is displayed, and then shown on some event.

mobius77 avatar Nov 27 '23 20:11 mobius77