1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
// 配置 页面路由
import React from "react";
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom'
import LoginPage from "../Pages/loginPage/index";
import ManagerPage from "../Pages/managerPage/index";
import IndexPage from "../Pages/managerPage/index/indexPage";
function MainPage() {
return (
<Router>
<Switch>
<Route path="/" exact >
<LoginPage/>
</Route>
<Route path="/login/" exact >
<LoginPage />
</Route>
<Route path="/index/" >
<ManagerPage >
<Switch>
<Route path="/index/" exact component={()=><div>ddd</div>}>
</Route>
<Route path="/index/test/" exact component={()=><div>ddd444</div>}>
</Route>
</Switch>
</ManagerPage>
</Route>
<Route path="*" render={()=><div>找不到页面</div>} />
</Switch>
</Router>
)
}
export default MainPage
|