根据文档,我获取 swiper 当前索引值用的是activeIndex
swiper.on('slideChangeTransitionEnd', function () {
console.log('swiper当前索引:',swiper.activeIndex);
}
但是在swiper配置了loop:true ,开启循环之后,索引 打印出来是错的…
在循环模式下,获取索引要通过realIndex,
console.log('swiper当前索引:',swiper.realIndex); // loop 模式下 realIndex