从现在开始记录学习过程,监督和督促自己不断学习,
构建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