微信小程序中,如何阻止多次点击单击事件

在微信小程序中,有自制对话框用于提交数据,但是会出现用户连续点击,多次提交数据的情况。

//.wxml

<
view class="acertain" bindtap="{{dis?'acertain':''}}" >确定</view>


//.js
//在 data中定义
data:{
dis:true}
acertain:function(){
...代码
this.setData({
  dis:false//设为方法为无
})
}
//在触发打开对话框的方法中重新启用对话框确定按钮方法
this.setData({
  dis:false//启用确定方法

})


猜你喜欢

转载自www.cnblogs.com/shanchui/p/12488990.html