refactor: ♻️ 更改了部分命名规则,调整部分内容

增加请求参数对于数组的判断和处理,编辑使用popup,页面优化
This commit is contained in:
Theo
2024-11-24 02:43:04 +08:00
parent 1bedd90d81
commit 8017903c1e
7 changed files with 221 additions and 343 deletions

17
src/utils/index.ts Normal file
View File

@@ -0,0 +1,17 @@
/**
* 防抖函数
* @param fn 函数
* @param delay 延迟时间
* @returns
*/
const debounce = <T extends (...args: any[]) => any>(fn: T, delay: number) => {
let timer: number | null = null;
return function (this: any, ...args: Parameters<T>) {
if (timer) clearTimeout(timer);
timer = setTimeout(() => {
fn.apply(this, args);
}, delay);
};
};
export { debounce };