Taro父子组件通信


父组件

  testEvent = () =>{
    console.log('abc123')
  }

 <Test test={1231323} onTestEvent={this.testEvent}></Test>

 子组件

  abc(){
    this.props.onTestEvent();
  console.log(this.props.test) } render () { return ( <View onClick={this.abc}> {this.props.test} </View> ) }

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM