關(guān)鍵字:
==>wp rest api
==>redux(三大塊:action、reducer、store)
==>各部分組件機(jī)構(gòu)
==>this.props.children(用于實(shí)現(xiàn)動(dòng)態(tài)組件)
==>axios
==>es6字符串的新寫法(` ?`反引號(hào))
==>connect的用法(import { connect } form 'react-redux')
==>middlewares的用法(異步發(fā)送action)
==>moment的用法(import moment form 'moment' )
==>容器組件和可視化組件
==>this.props用于父組件傳遞數(shù)據(jù)給子組件,父組件申明一個(gè)自定義屬性并設(shè)值<Child name="roy">,子組件接受這個(gè)自定義屬性的值{this.props.name},getDefaultProps方法,設(shè)置默認(rèn)的props值。
==>this.setState用于input等互動(dòng)型的組件,getInitialState方法。變更的父組件state后通過(guò)props傳遞給子組件。
==>wp rest api:
1.安裝phpStudy和wordpress
2.phpStudy站點(diǎn)域名設(shè)置和hosts內(nèi)容添加


3.wordpress安裝wp rest api插件
給瀏覽器安裝json-handler插件,這樣獲取的json格式能在瀏覽器當(dāng)中自動(dòng)換行顯示
==>redux:
三大塊:action、reducer、store,它們都是相應(yīng)的函數(shù)處理模塊,三者的順序?yàn)橄萢ction,然后reducer,最后store。
action:返回一個(gè)對(duì)象給reducer,觸發(fā)動(dòng)作
reducer:處理接受action傳遞過(guò)來(lái)的東西
store:接收reducer傳遞過(guò)來(lái)的東西,其相當(dāng)于一個(gè)倉(cāng)庫(kù),把網(wǎng)站的所有數(shù)據(jù)都儲(chǔ)存在里面




==>各部分組件機(jī)構(gòu):









組件模板:
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' ):


