When using swipe in the Vue Composition API, how do I get the index when swiping?

37 views Asked by At

I am now getting the swiped index like this:

const updateCurrentSlide = (e: any) => {
  currentSlide.value = slides.value[e.activeIndex];
};
..
 <swiper
      @slideChange="updateCurrentSlide"
    >

However, when autoplaying, the index does not change, Also, when you move the slide with the mouse, the index changes too sensitively. For example, when I swipe, I expected the index to change sequentially like 0, 1, 2, but it also changes like this: 0, 2, 2, 2, 1. What should I do?

0

There are 0 answers