react 子组件向父组件传值

//子组件
this.props.handle(num);

//父组件

handle=(num)=>{
     this.setState({
          num:num
     })
}
<子组件 handle={this.handle} >

  

posted @ 2018-10-23 10:54  闰土的土  阅读(525)  评论(0编辑  收藏  举报