react學習之路01

從現在開始記錄學習過程,監督和督促自己不斷學習,

構建react項目;npx create-react-app 項目名

搭建後臺管理系統  antd

常用的路由有三種方式   React Router

1. browserHistory

import { browserHistory } from 'react-router'
render(
  <Router history={browserHistory} routes={routes} />,
  document.getElementById('app')
)

 

路徑:/path/path

2.hashHistory

路徑:/path/#/path

不需要服務器配置

3.createMemoryHistory

 

const history = createMemoryHistory(location)

文檔地址:http://react-guide.github.io/react-router-cn/docs/guides/basics/Histories.html

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章