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頁面的跳轉實現


分享到:


相關文章: