Swiper循环回到首张幻灯片时点击事件失效问题求助
Swiper循环切换时点击事件失效问题
当Swiper循环回到首张幻灯片时,点击事件无法正常触发,点击处理函数在以下场景中失效:
- 从最后一张幻灯片
< 4/4 >点击>箭头时 - 从第一张幻灯片
< 1/4 >点击<箭头时

参考代码片段
mounted(): void { new Swiper(this.$refs.swiper, { modules: [Navigation, Pagination, Autoplay], // SwiperOptions loop: true, loopFillGroupWithBlank: true, autoplay: { delay: 4 * SECOND, disableOnInteraction: false, }, speed: SECOND / 2, observer: true, observeParents: true, parallax: true, preventClicks: false, preventClicksPropagation: false, centeredSlides: true, slideToClickedSlide: true, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev', }, pagination: { el: '.swiper-pagination', clickable: true, }, on: { slideChange: (swiper) => { this.activeIndex = swiper.realIndex }, touchEnd: (swiper) => { this.activeIndex = swiper.realIndex }, }, }) }
已在网上搜索相关解决方案但未找到有效办法,恳请协助解决。
内容的提问来源于stack exchange,提问作者Penny Liu
相关产品推荐
相关产品推荐

