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> ) }

 

posted @ 2019-01-24 09:41  安筱雨  阅读(2906)  评论(0编辑  收藏  举报