在swiper中显示echarts图表,echarts的点击事件无效,图例点击也没有反应

给swiper添加   touchStartPreventDefault 属性

//添加swiper轮播
initSwiper() {
  const mySwiper = new Swiper('.swiper-container', {
    slidesPerView: 1, //设置slide能够同时显示的slides的数量
    spaceBetween: 12, //在slide直接设置距离
    touchStartPreventDefault:false, //添加这个属性 默认不阻止事件
    autoplay: {
      delay: 6000, //自动切换的时间间隔,
      disableOnInteraction: false //用户操作swiper之后,是否禁止autoplay 默认为true
    }
  })
  mySwiper.el.onmouseover = function() {
    mySwiper.autoplay.stop()
  }
  mySwiper.el.onmouseout = function() {
    mySwiper.autoplay.start()
  }
},

就可以完美的解决了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值