debounce(func, delay) {
let timer = null;
console.log(func);
return function (...args) {
console.log(timer);
if (timer) clearTimeout(timer);
timer = setTimeout(() => {
func.apply(this, args);
}, delay);
};
}
js防抖方法
最新推荐文章于 2025-03-22 15:30:05 发布