react项目实战学习笔记-学习8-路由配置
2023-03-08 10:54:10 阅读次数:294
App,List,javascript
// App>List+Edit+means Login Register
import App from "../App";
import List from "../pages/List";
import Edit from "../pages/Edit";
import Means from "../pages/Means";
import Login from "../pages/Login";
import Register from "../pages/Register";
import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
const BaseRouter = () => {
return (
<Router>
<Routes>
<Route path="/" element={<App />}>
<Route path="/list" element={<List />}></Route>
<Route path="/edit" element={<Edit />}></Route>
<Route path="/means" element={<Means />}></Route>{" "}
</Route>
<Route path="/login" element={<Login />}></Route>
<Route path="/Register" element={<Register />}></Route>
</Routes>
</Router>
);
};
export default BaseRouter;
版权声明:本文内容来自第三方投稿或授权转载,原文地址:https://blog.51cto.com/u_15460007/6053023,作者:前端导师歌谣,版权归原作者所有。本网站转在其作品的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如因作品内容、版权等问题需要同本网站联系,请发邮件至ctyunbbs@chinatelecom.cn沟通。
上一篇:Vue课程23-配置build命令
下一篇:前端hook项目重构笔记2-重构之裁剪上传功能