【发布时间】:2018-07-04 17:45:04
【问题描述】:
我正在尝试在应用程序启动时将我的应用程序重定向到特定路线。我试过这个
<Route exact path="/todos" component={Todo} />
<Route exact path="/users" component={User} />
<Redirect path="/" to="/todos" />
但它有两个问题
- 它在刷新时将我重定向到 todos 路由
- 它给了我以下警告
You tried to redirect to the same route you're currently on: "/todos"
我想像我们一样在 Angular 中实现重定向概念:
{ path: '', redirectTo: '/heroes', pathMatch: 'full' },
【问题讨论】:
标签: angularjs reactjs redirect react-router