当前位置: 代码迷 >> 综合 >> JavaScript实现input连续输入,只发一次请求
  详细解决方案

JavaScript实现input连续输入,只发一次请求

热度:97   发布时间:2024-03-06 23:25:03.0

handleSearch() {
                if (this.keyword != '') {
                    // 实现input连续输入,只发一次请求
                    clearTimeout(this.timeout)
                    this.timeout = setTimeout(() => {
                      this.pageNum = 1;
                      this.finished = false;
                      this.total = 0;
                      this.orderList = [];
                      this.onLoadMore();
                    }, 1000)
                    
                }
            }

  相关解决方案