// 防抖函数
export const debounce = (fn, wait = 1000) => {
  let timer;
  return function (...args) {
    clearTimeout(timer);
    timer = setTimeout(() => {
      fn.call(this, args);
    }, wait);
  };
};