react 子组件向父组件传值

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

//父组件

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

  

猜你喜欢

转载自www.cnblogs.com/orzzt/p/9835409.html