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

(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页面的跳转实现


分享到:


相關文章: