<view @tap="a" @longtap="longtap" @touchstart='touchstart' @touchend='touchend'>demo</view>
data(){
touchT:'',
touchE:''
},
methods:{
longtap(){
console.log('长按')
},
touchstart(){
this.touchT = new Date().getTime();
},
touchend(){
this.touchE = new Date().getTime();
},
a(){
if(this.touchE-this.touchT<350){
console.log('点击')
}
},
}
冲突问题是解决了,最后发现经过一次长按点击不能触发了,解决方法如下
将touchT,touchE清空