react 路由

須要下包 react-router-dom 分倆種路由模式 hash 和 history 全部的根組件只能調用一次,由於一個瀏覽器只有一個url地址,且全部的組件只能在根組件內使用 HashRouter組件(hash模式) 使用window.location.hash 和 hashchange 事件構建路由 BrowserRouter組件(history模式) 使用pushState 和 popS
相關文章
相關標籤/搜索