VUE使用Swiper组件,组件中嵌套Echarts图,Echarts的点击事件不生效问题解决

发布时间 2023-12-18 17:33:02作者: FairyTale安北

1.解决方案

在Swiper的配置项中添加以下属性(实测,已解决)
` options: {
    loop: false,
    simulateTouch: true, 
    autoplay: {
      delay: 10000,
      disableOnInteraction: true 
    },
    touchStartPreventDefault: false, // 添加这个属性 默认不阻止事件
  }

`
官方是这么介绍的
阻止touchstart (mousedown)的默认事件,设置为false则不阻止。
touchStartPreventDefault信息