refactor:优化移动端页面

This commit is contained in:
jiangrui
2025-03-05 12:29:47 +08:00
parent 680108f499
commit 604ba2eec6
12 changed files with 793 additions and 309 deletions

View File

@@ -14,3 +14,16 @@ export function isMobileDevice() {
window.innerWidth <= 768
);
}
export function throttle<T extends (...args: any[]) => any>(fn: T, delay: number): T {
let lastTime = 0;
return function (this: any, ...args: Parameters<T>) {
const now = Date.now();
if (now - lastTime >= delay) {
fn.apply(this, args);
lastTime = now;
}
} as T;
}