<view bindtap="test3" bindtouchstart="test1" bindtouchend="test2"></view>
text1(){
console.log(‘开始按下’)
this.setData({
clickFlag:true
})
this.data.timer = setTimeout(()=>{
console.log(‘触发事件’)
},1000)
this.setData({
timer:this.data.timer
})
},
test2(){
clearTimeout(this.data.timer)
},
test3(){
if(this.data.clickFlag)
console.log(‘click触发’)
}
原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/275368.html