pref: 代码打包优化

This commit is contained in:
zdl
2025-10-13 19:53:13 +08:00
parent dcef2fab1a
commit cd50d718fe
20 changed files with 14957 additions and 173 deletions

View File

@@ -6,10 +6,11 @@ import PanelContainer from "components/Layout/PanelContainer";
import PanelContent from "components/Layout/PanelContent";
import Sidebar from "components/Sidebar/Sidebar.js";
import { SidebarContext } from "contexts/SidebarContext";
import React, { useState } from "react";
import React, { useState, Suspense } from "react";
import { Route, Routes, Navigate } from "react-router-dom";
import routes from "routes.js";
import PageLoader from "components/Loading/PageLoader";
const Landing = () => {
const [toggleSidebar, setToggleSidebar] = useState(false);
@@ -18,10 +19,15 @@ const Landing = () => {
const getRoutes = (routes) => {
return routes.map((route, key) => {
if (route.layout === "/landing") {
const Component = route.component;
return (
<Route
path={ route.path}
element={route.component}
path={route.path}
element={
<Suspense fallback={<PageLoader message="加载中..." />}>
<Component />
</Suspense>
}
key={key}
/>
);