swiper.js 循环模式下索引不正确的解决方法

根据文档,我获取 swiper 当前索引值用的是activeIndex
swiper.on('slideChangeTransitionEnd', function () {
console.log('swiper当前索引:',swiper.activeIndex);
}
但是在swiper配置了loop:true ,开启循环之后,索引 打印出来是错的...
在循环模式下,获取索引要通过realIndex,
console.log('swiper当前索引:',swiper.realIndex); // loop 模式下 realIndex
THE END
二维码
海报
swiper.js 循环模式下索引不正确的解决方法
swiper.js 在loop循环模式下索引值错误的解决方法
匿名
东明兄@匿名