@zhongjianxin
2018-07-18T09:29:07.000000Z
字数 974
阅读 826
OOCL
React 介绍
React 的工作机制
class ListUI extends React.Component{
render(){
let data = this.props.data;
return (
<ul>
{data.map(item => <li key={item.id} >{item.text}</li>)}
</ul>
)
}
}
class List extends React.Component{
constructor(){
super();
this.getData = this.getData.bind(this);
}
render(){
let data = this.getData();
return <ListUI data={data} />
}
getData(){
return [{id : 1,text : 'hello'},{id : 2,text : 'world'}];
}
}
- CSS 内嵌
- Counter Component
https://www.cnblogs.com/doudoublog/p/7775441.html
- Todo List App