我有以下
mySwiper = new Swiper('.my-swiper', {
direction: 'vertical',
loop: true,
});
mySwiper.on('slideChange', function () {
console.log('*** mySwiper.realIndex', mySwiper.realIndex);
});
Run Code Online (Sandbox Code Playgroud)
但realIndex总是返回前一个索引。因此,如果我在第一张幻灯片 (0) 上并转到下一张,realIndex则应realIndex为 1 时为 0。当我返回第一张幻灯片时为 1,而应为 0。因此似乎事件在索引已更新。我尝试过其他活动,但没有任何运气。是否有在幻灯片更改后触发的事件,以便我可以捕获当前幻灯片索引?