web-backset.cn/apps/web/src/App.tsx

28 lines
620 B
TypeScript
Raw Normal View History

2023-02-27 11:23:36 +08:00
import { Route, Routes, useNavigate } from "react-router-dom";
import "./assets/base.less";
import Nav from "./components/Nav";
import { routerList } from "./router";
import { Guard } from "./router/Guard";
function App() {
return (
<>
<Nav />
<main>
<Routes>
{routerList.map((router) => (
<Route
key={router.path}
path={router.path}
element={<Guard>{router.element}</Guard>}
/>
))}
<Route path="*" element={<span>404</span>} />
</Routes>
</main>
</>
);
}
export default App;