点击swiper 获取当前下标 两种模式
"swiper": "^5.4.5", "vue-awesome-swiper": "^3.1.3",
swiperOption: {
autoplay: { delay: 3000 },
loop: true, //循环
slidesPerView: 'auto',
direction: "vertical",
disableOnInteraction: true,
preventLinksPropagation: false,
on: {
click: () => {
console.log(this.$refs.swiperRef.swiper.realIndex);
},
}
},
swiperOption: {
autoplay: { delay: 3000 },
loop: false, //不循环
slidesPerView: 'auto',
direction: "vertical",
disableOnInteraction: true,
preventLinksPropagation: false,
on: {
click: () => {
console.log(this.$refs.swiperRef.swiper.clickedIndex);
},
}
},
swiper 点击事件
最新推荐文章于 2024-01-23 16:51:24 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)