從現在開始記錄學習過程,監督和督促自己不斷學習,
構建react項目;npx create-react-app 項目名
搭建後臺管理系統 antd
常用的路由有三種方式 React Router
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