dayin1
changeSearchVal(e){
    let keyWord = e.detail.value ? e.detail.value : null
    let that = this;
    if(timer){
      clearTimeout(timer)
    }
    timer = setTimeout(()=>{
      if(keyWord==null){
        //这里表示  如果搜索框中没有数据的话,做的一些处理
      }else{
        //这里是搜索框中有值的情况,可以直接请求搜索接口即可
      }
    },1000)
    that.setData({
      searchVal:keyWord,
      timer:null
    })

    },

 

分类:

技术点:

相关文章:

  • 2021-10-07
  • 2021-10-07
  • 2021-10-07
  • 2021-12-16
  • 2021-05-15
  • 2021-10-30
  • 2022-01-02
  • 2021-11-24
猜你喜欢
  • 2021-10-07
  • 2021-10-07
  • 2021-10-07
  • 2021-11-24
  • 2021-11-24
  • 2021-08-01
  • 2021-11-24
相关资源
相似解决方案