摘要: class Parent extends React.Component{ constructor(){ super(); this.state={co:"red"} } render(){ return( <Child color={this.state.co}></Child> ) } } cl 阅读全文
posted @ 2019-09-03 21:38 //toMe 阅读(199) 评论(0) 推荐(0) 编辑
摘要: class Child extends React.Component{ constructor(props){ super(props); this.state={child:"我是子组件的值"}; this.props.getChild(this.state.child); } render() 阅读全文
posted @ 2019-09-03 21:34 //toMe 阅读(536) 评论(0) 推荐(0) 编辑