小程序如何动态解除事件绑定

发布于 7 年前作者 dguo10747 次浏览最后编辑 7 年前来自 ask

<view hidden=“{{currentTab!==0}}” bindtouchstart=‘chstart’ bindtouchmove=chmove bindtouchend=‘chend’>

</view>

chend事件有没有办法解除 chstart和chmove事件

2 回复
wyang
wyang1 楼6 年前

你可以在chend 的时候,加个布尔值标志A,然后chstart和chmove里判断,如果A==true,就直接return

chengchao
chengchao2 楼5 年前

在JS里面加个标识,然后更改这个标识的值, 类似这种写法