防止连续点击

if(this.isClick) {
this.isClick = false;

//定时器
setTimeout(function() {
this.isClick = true;
}, 1000);//一秒内不能重复点击
}


isClick: null,
  handleSearch(e) {
    //文字s搜索交接人
    const { value } = e.detail;
    clearTimeout(this.isClick);
    this.isClick = setTimeout(() => {
      console.log(value);
    }, 1000);
  },
posted @ 2021-12-11 11:25  李笑吅  阅读(70)  评论(0编辑  收藏  举报