perf(frontend): 路由级代码分割 — React.lazy + Suspense

将所有页面组件改为按路由懒加载,Layout 组件保持静态导入。
新增 LoadingSpinner 作为 Suspense 回退组件。
html5-qrcode (~200KB) 和 antd 仅在访问扫码/管理后台路由时加载。
This commit is contained in:
2026-08-06 17:33:48 +08:00
parent 6a79e21302
commit 9d204a57d8
2 changed files with 48 additions and 30 deletions

View File

@ -0,0 +1,10 @@
import { Loader2 } from "lucide-react";
/** 全局路由懒加载回退组件 */
export default function LoadingSpinner() {
return (
<div className="flex items-center justify-center py-32">
<Loader2 className="h-8 w-8 animate-spin text-blue-500" />
</div>
);
}