function throttle(fn){
let timer = null;
return function(){
if(timer) return
timer = setTimeout(()=>{
fn.apply(this,arguments)
timer = null
},500)
}
}
throttle(()=>{
console.log('节流');
})
节流-input
于 2023-09-07 14:50:28 首次发布