关键字:
==>wp rest api
==>redux(三大块:action、reducer、store)
==>各部分组件机构
==>this.props.children(用于实现动态组件)
==>axios
==>es6字符串的新写法(` `反引号)
==>connect的用法(import { connect } form 'react-redux')
==>middlewares的用法(异步发送action)
==>moment的用法(import moment form 'moment' )
==>容器组件和可视化组件
==>this.props用于父组件传递数据给子组件,父组件申明一个自定义属性并设值<Child name="roy">,子组件接受这个自定义属性的值{this.props.name},getDefaultProps方法,设置默认的props值。
==>this.setState用于input等互动型的组件,getInitialState方法。变更的父组件state后通过props传递给子组件。
==>wp rest api:
1.安装phpStudy和wordpress
2.phpStudy站点域名设置和hosts内容添加
3.wordpress安装wp rest api插件
给浏览器安装json-handler插件,这样获取的json格式能在浏览器当中自动换行显示
==>redux:
三大块:action、reducer、store,它们都是相应的函数处理模块,三者的顺序为先action,然后reducer,最后store。
action:返回一个对象给reducer,触发动作
reducer:处理接受action传递过来的东西
store:接收reducer传递过来的东西,其相当于一个仓库,把网站的所有数据都储存在里面
==>各部分组件机构:
组件模板:
importReact, { Component }from'react';
export default classFooterextendsComponent {
constructor(props) {
super(props);
}
render() {
return(
Designed By @Blwoosky
Copyright © 2013-2015 BlwooSky.COM
);
}
}
==>moment的用法(import moment form 'moment' ):