fix: 修复类型定义及多处逻辑缺陷
- 补充字典项备注字段及部门排序必填约束 - 使用 Ref/ComputedRef 替代 ReturnType 简化类型 - 兜底胶囊按钮默认尺寸,避免获取失败时导航栏异常 - 移除不可靠的新版 API 降级调用,统一使用 getSystemInfoSync - 修复防抖函数定时器未清空及类型不严谨问题
This commit is contained in:
@@ -5,11 +5,12 @@
|
||||
* @returns
|
||||
*/
|
||||
const debounce = <T extends (...args: any[]) => any>(fn: T, delay: number) => {
|
||||
let timer: number | null = null;
|
||||
let timer: ReturnType<typeof setTimeout> | null = null;
|
||||
return function (this: any, ...args: Parameters<T>) {
|
||||
if (timer) clearTimeout(timer);
|
||||
if (timer !== null) clearTimeout(timer);
|
||||
timer = setTimeout(() => {
|
||||
fn.apply(this, args);
|
||||
timer = null;
|
||||
}, delay);
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user