diff --git a/package.json b/package.json
index 50c3cc6..5a5539d 100644
--- a/package.json
+++ b/package.json
@@ -9,8 +9,14 @@
"preview": "vite preview"
},
"dependencies": {
+ "antd": "^5.3.2",
+ "localforage": "^1.10.0",
+ "match-sorter": "^6.3.1",
"react": "^18.2.0",
- "react-dom": "^18.2.0"
+ "react-dom": "^18.2.0",
+ "react-router-dom": "^6.9.0",
+ "sort-by": "^1.2.0",
+ "web-vitals": "^3.3.0"
},
"devDependencies": {
"@types/react": "^18.0.28",
diff --git a/src/App.tsx b/src/App.tsx
index 1e9e0fe..8e63992 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -1,35 +1,15 @@
-import { useState } from 'react'
-import reactLogo from './assets/react.svg'
-import viteLogo from '/vite.svg'
-import './App.scss'
+import { useRoutes } from "react-router-dom";
+import routes from "./routes";
+import "./App.scss";
function App() {
- const [count, setCount] = useState(0)
+ const Views = () => useRoutes(routes);
return (
-
-
-
Vite + React
-
-
-
- Edit src/App.tsx
and save to test HMR
-
-
-
- Click on the Vite and React logos to learn more
-
+
+
- )
+ );
}
-export default App
+export default App;
diff --git a/src/assets/react.svg b/src/assets/react.svg
deleted file mode 100644
index 6c87de9..0000000
--- a/src/assets/react.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/src/main.tsx b/src/main.tsx
index d77ab5b..87595b1 100644
--- a/src/main.tsx
+++ b/src/main.tsx
@@ -1,10 +1,30 @@
-import React from 'react'
-import ReactDOM from 'react-dom/client'
-import App from './App'
-import './index.scss'
+import React from "react";
+import ReactDOM from "react-dom/client";
+import reportWebVitals from "./reportWebVitals";
+import { BrowserRouter } from "react-router-dom";
+import { ConfigProvider } from "antd";
+import zhCN from "antd/locale/zh_CN";
+import App from "./App";
+import "./index.scss"; //全局样式
-ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
+const root = ReactDOM.createRoot(
+ document.getElementById("root") as HTMLElement
+);
+
+ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
-
- ,
-)
+
+
+
+
+
+
+);
+
+// If you want to start measuring performance in your app, pass a function
+// to log results (for example: reportWebVitals(console.log))
+// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
+reportWebVitals();
diff --git a/src/pages/index.ts b/src/pages/index.ts
new file mode 100644
index 0000000..ca84c27
--- /dev/null
+++ b/src/pages/index.ts
@@ -0,0 +1,2 @@
+export * from './login';
+export * from './layout';
\ No newline at end of file
diff --git a/src/pages/layout/index.module.scss b/src/pages/layout/index.module.scss
new file mode 100644
index 0000000..e69de29
diff --git a/src/pages/layout/index.tsx b/src/pages/layout/index.tsx
new file mode 100644
index 0000000..ff78cfc
--- /dev/null
+++ b/src/pages/layout/index.tsx
@@ -0,0 +1,3 @@
+export const LayoutPage = () => {
+ return <>我是布局文件>
+}
\ No newline at end of file
diff --git a/src/pages/login/index.module.scss b/src/pages/login/index.module.scss
new file mode 100644
index 0000000..e69de29
diff --git a/src/pages/login/index.tsx b/src/pages/login/index.tsx
new file mode 100644
index 0000000..257d12e
--- /dev/null
+++ b/src/pages/login/index.tsx
@@ -0,0 +1,3 @@
+export const LoginPage = ()=>{
+ return <>我是登录界面>
+}
\ No newline at end of file
diff --git a/src/reportWebVitals.ts b/src/reportWebVitals.ts
new file mode 100644
index 0000000..49a2a16
--- /dev/null
+++ b/src/reportWebVitals.ts
@@ -0,0 +1,15 @@
+import { ReportHandler } from 'web-vitals';
+
+const reportWebVitals = (onPerfEntry?: ReportHandler) => {
+ if (onPerfEntry && onPerfEntry instanceof Function) {
+ import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
+ getCLS(onPerfEntry);
+ getFID(onPerfEntry);
+ getFCP(onPerfEntry);
+ getLCP(onPerfEntry);
+ getTTFB(onPerfEntry);
+ });
+ }
+};
+
+export default reportWebVitals;
diff --git a/src/routes/index.tsx b/src/routes/index.tsx
new file mode 100644
index 0000000..373c35a
--- /dev/null
+++ b/src/routes/index.tsx
@@ -0,0 +1,17 @@
+import { RouteObject } from "react-router-dom";
+
+import { LoginPage, LayoutPage } from "../pages";
+
+const routes: RouteObject[] = [
+ {
+ path: "/",
+ element:
,
+ children: [],
+ },
+ {
+ path: "/login",
+ element:
,
+ },
+];
+
+export default routes;