可以通过设置 touchable 属性为 false 来禁止右滑。具体来说,可以在 swiper-item 标签中添加 touchable="false" 的属性,例如:

<swiper>
  <swiper-item touchable="false">
    <!-- 这里是第一个滑块的内容 -->
  </swiper-item>
  <swiper-item touchable="false">
    <!-- 这里是第二个滑块的内容 -->
  </swiper-item>
</swiper>

这样用户就无法通过滑动右侧来触发右滑操作了。

uniapp swiper 禁止右滑

原文地址: http://www.cveoy.top/t/topic/bAqT 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录