关于swiper.js 与echarts结合导致的问题记录

120 阅读1分钟

lenged 点击失效

1、Vue中处理方式 增加属性 :touchStartPreventDefault="false"

<swiper
    :direction="direction"
    :modules="modules"
    :loop-additional-slides="2"
    :loop="loop"
    :spaceBetween="0"
    :centeredSlides="false"
    :autoplay="{
      delay: delay,
      disableOnInteraction: true,
      pauseOnMouseEnter: true,
    }"
    :pagination="showpage ? pagination : false"
    :touchStartPreventDefault="false"
    @slideChange="slideChange"
  >
  </swiper>

2、原生中处理方式 增加option属性:touchStartPreventDefault: false

var mySwiper = new Swiper('.swiper-container', {
    touchStartPreventDefault: false,
});