函数节流的使用:检索框@input,限制发送请求频率 //定义一个变量开始为false let isSend = false //检索框input会一直触发sendFun方法 sendFun(){ //判断isSend,如果为true执行return if(isSend){ return } //如果为false,将变量赋值为true isSend = true setTimeout(()=>{ //变量isSend重新赋值为false isSend = false },300) }