<input v-model="searchInput" @input="handleInput"/>

2. data里加一个timeoutId: ""

3. methods里写:

handleInput() {
    if (this.timeoutId) {
        clearTimeout(this.timeoutId)
    }
    this.timeoutId = setTimeout(this.query, 600)
},
query(){
    //下面写请求数据的代码
}

参考原文地址:https://blog.csdn.net/EllynX/article/details/112392479

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-29
  • 2022-12-23
相关资源
相似解决方案