App.tsx 880 B

12345678910111213141516171819202122232425262728293031
  1. import "@/assets/styles/base.css";
  2. // 关于路由
  3. import React from "react";
  4. import { Router, Route, Switch } from "react-router-dom";
  5. import history from "./utils/history";
  6. import SpinLoding from "./components/SpinLoding";
  7. import MessageCom from "./components/Message";
  8. import NotFound from "./components/NotFound";
  9. const A1Home = React.lazy(() => import("./pages/A1Home"));
  10. export default function App() {
  11. return (
  12. <>
  13. {/* 关于路由 */}
  14. <Router history={history}>
  15. <React.Suspense fallback={<SpinLoding />}>
  16. <Switch>
  17. {/* 首页 */}
  18. <Route path="/" exact component={A1Home} />
  19. {/* 找不到页面 */}
  20. <Route path="*" component={NotFound} />
  21. </Switch>
  22. </React.Suspense>
  23. </Router>
  24. {/* antd 轻提示 ---兼容360浏览器 */}
  25. <MessageCom />
  26. </>
  27. );
  28. }