constructor(props) {
this.buttonEnable = true;//控制按钮不能同一时间多次点击
}
//控制0.5秒内不可多次点击
if(!this.buttonEnable){
return;
}
this.buttonEnable = false;
function a(){
}
this.setTimer = setTimeout(()=>{
this.buttonEnable = true;
}, 300);
componentWillUnmount(){
this.setTimer && clearTimeout(this.setTimer);
};