refactor: ♻️ 优化系统配置和通知公告的页面

优化系统配置和通知公告的页面
This commit is contained in:
Theo committed 2024-11-23 00:07:08 +08:00
1 parent f8a1fdf8cf
commit 2e5e59d10c
8 files changed
+382 -697

No files matched your search

+17
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 };