this.state = {
a:(open)=>{
this.setState({
open : !this.state.open
})
console.log(this.state.open)
}
}
通过a将函数传递下来,再通过serState变更值
<div onClick = { this.props.data.a }></div>
标签:asc tst ons OLE 通过 state pen blog set
this.state = {
a:(open)=>{
this.setState({
open : !this.state.open
})
console.log(this.state.open)
}
}
通过a将函数传递下来,再通过serState变更值
<div onClick = { this.props.data.a }></div>
标签:asc tst ons OLE 通过 state pen blog set
原文地址:https://www.cnblogs.com/jilaokang/p/8672463.html