首先引入Redirect

import {Link,Route,Redirect} from  'react-router-dom'

利用from or to

<Redirect from={"/"} to={'/index'}/>

如果遇到斜杠“ / ” 就直接跳转“ /index ”

和vue路由重向原理差不多

相关文章:

  • 2021-07-02
  • 2021-12-02
  • 2022-12-23
  • 2022-12-23
  • 2022-02-15
  • 2022-12-23
  • 2022-12-23
  • 2021-07-08
猜你喜欢
  • 2022-02-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-12
  • 2021-09-13
相关资源
相似解决方案