T***@163.com
T***@163.com
  • 发布:2019-11-22 15:43
  • 更新:2021-03-24 11:22
  • 阅读:768

touchmove问题

分类:uni-app
<template>  
  <view class="content">  
    <swiper class="swiper" :duration="300">  
      <swiper-item @touchmove="onTouchmove"><view class="box">1</view></swiper-item>  
      <swiper-item><view class="box">2</view></swiper-item>  
      <swiper-item><view class="box">3</view></swiper-item>  
    </swiper>  
  </view>  
</template>  

<script>  
export default {  
  data() {  
    return {  
    };  
  },  
  onLoad() {},  
  methods: {  
    onTouchmove(event) {  
      // console.log(event)  

       // 为什么不能阻止touchmove?.stop 可以生效,但是我要基于事件对象编程  
      event.preventDefault()  
      event.stopPropagation()  
    }  
  }  
};  
</script>  

<style>  
.swiper {  
  height: 2000px;  
}  
.box {  
  padding-top: 100px;  
  text-align: center;  
  font-size: 25px;  
}  
</style>  
2019-11-22 15:43 负责人:无 分享
已邀请:
爱睡觉的考拉

爱睡觉的考拉

我也是啊,不知道怎么解决,真的可以解决就好了

该问题目前已经被锁定, 无法添加新回复