From a5a57c1b99df364d687c5b80fff54c791888935b Mon Sep 17 00:00:00 2001 From: none Date: Tue, 21 Mar 2023 13:45:43 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=AF=E7=94=B1=E6=87=92=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=20+=20loading?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.tsx | 6 ++++-- src/pages/loading/index.tsx | 11 +++++++++++ src/routes/index.tsx | 1 + 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 src/pages/loading/index.tsx diff --git a/src/App.tsx b/src/App.tsx index 8e63992..cc355fc 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,14 +1,16 @@ import { useRoutes } from "react-router-dom"; import routes from "./routes"; import "./App.scss"; +import { Suspense } from "react"; +import LoadingPage from "./pages/loading"; function App() { const Views = () => useRoutes(routes); return ( -
+ }> -
+ ); } diff --git a/src/pages/loading/index.tsx b/src/pages/loading/index.tsx new file mode 100644 index 0000000..df80a52 --- /dev/null +++ b/src/pages/loading/index.tsx @@ -0,0 +1,11 @@ +import { Spin } from "antd"; + +const LoadingPage = () => { + return ( + <> + + + ); +}; + +export default LoadingPage; diff --git a/src/routes/index.tsx b/src/routes/index.tsx index f0bd5c7..536a473 100644 --- a/src/routes/index.tsx +++ b/src/routes/index.tsx @@ -3,6 +3,7 @@ import { RouteObject } from "react-router-dom"; import { LayoutPage } from "../pages"; +// 懒加载 const LoginPage = lazy(() => import('../pages/login')) const routes: RouteObject[] = [