react路由
程序员文章站
2024-02-14 15:01:10
...
主页,登陆,注册
return (
<Router>
<Switch>
<Route exact path='/' component={AA} />
<Route path='/login' component={BB} />
<Route path='/register' component={CC} />
<Redirect to='/login'/>
</Switch>
</Router>
);
react router
基础组件
// Routers
<BrowserRouter> and <HashRouter>
// Route Matching
<Route> and <Switch>
component render children
// Navigation
<Link> and <NavLink>
- 参考
react router https://reacttraining.com/react-router/web/guides/basic-components
上一篇: 计算机网络基础
下一篇: @PathVariable注解的使用