You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
628 B
29 lines
628 B
// 引入两个组件
|
|
import Login from "./Login";
|
|
import Layout from "./Layout";
|
|
import Board from "./Board";
|
|
import Article from "./Article";
|
|
|
|
import { BrowserRouter, Routes, Route} from "react-router-dom"
|
|
|
|
// 进行路由配置
|
|
function App() {
|
|
return (
|
|
|
|
<BrowserRouter>
|
|
|
|
<Routes>
|
|
|
|
<Route path="/" element={<Layout/>}>
|
|
{/* 定义二级路由嵌套 */}
|
|
<Route path="board" element={<Board/>}></Route>
|
|
<Route path="Article" element={<Article/>}></Route>
|
|
</Route>
|
|
|
|
<Route path="login" element={<Login/>}></Route>
|
|
</Routes>
|
|
</BrowserRouter>
|
|
);
|
|
}
|
|
|
|
export default App;
|