html

<div class="test" @touchstart="gtouchstart()">按啊</div>

js

data(){
return {
    
timeOutEvent: 0 ,// 长按事件定时器
  }
}
methods: { gtouchstart () {
// 开始触摸 this.timeOutEvent = setTimeout(() => { // 长按2秒 this.timeOutEvent = 0 alert('ggg') }, 2000) }, }

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-24
  • 2021-05-27
  • 2022-12-23
相关资源
相似解决方案