0

React 全家桶+AntD搭建后台管理系统

Posted by Alan on August 20, 2018 in Coding |

React 全家桶+AntD搭建后台管理系统

基础知识

React 特点

  • Declarative 声明式编码
  • Component-Based 组件化编码
  • 高效-高效的 DOM Diff算法,最小化页面重绘
  • 单向数据流

Vue & React 生态

Vue + Vue-Router + Vuex + Axios + Babel + Webpack
React + React-Router – Redux + Axios + Babel +Webpack

React 脚手架、Yarn

React 生命周期

getDefaultProps
getInitialState
componentWillMount
render
componentDidMount
componentWillReceiveProps
shouldComponentUpdate
componentWillUpdate
componentDidUpdate
componentWillUnmount

React Router 4.0
react-router(基础包)
react-router-dom(针对浏览器端,已包含 react-router)提供了BrowserRouter, HashRouter, Route(path, exact, component, render), Link, NavLink, switch, redirect
yarn add react-router-dom
获取动态路由参数:this.props.match.params.xxx

获取子节点:this.props.children

Tags: , ,

Leave a Reply

Copyright © 2012-2018 记录点滴生活 | Alan Hou的个人博客 All rights reserved.