(1) 从react-router-dom里导入Switch,Route和Redirect组件:

SAP UI5 Web Component不同React页面的跳转实现

(2) 路径/home指定成加载Home Component ,/detail则加载Detail Component.

SAP UI5 Web Component不同React页面的跳转实现

文件Home.jsx和Detail.jsx分别实现Component:

SAP UI5 Web Component不同React页面的跳转实现

(3) 测试:url后加上/home,则加载home Component:

SAP UI5 Web Component不同React页面的跳转实现

/detail组件的加载:

SAP UI5 Web Component不同React页面的跳转实现

要获取更多Jerry的原创文章,请关注公众号"汪子熙":
SAP UI5 Web Component不同React页面的跳转实现

相关文章:

  • 2022-12-23
  • 2021-05-26
  • 2022-12-23
  • 2022-12-23
  • 2021-07-03
  • 2021-07-11
  • 2022-12-23
  • 2021-09-14
猜你喜欢
  • 2021-10-13
  • 2021-08-17
  • 2021-09-30
  • 2021-05-18
  • 2021-07-23
  • 2021-11-06
  • 1970-01-01
相关资源
相似解决方案