🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
~~~ class Input extends React.Component { constructor(props) { super(props); this.state = { value: '' }; } render() { return <input style={{ width: 120 }} value={this.state.value} onChange={this.onChange} />; } onChange = (e) => { console.log(e.target.value) } } ~~~ ## 向事件处理程序传递参数 ~~~ <button onClick={() => this.handleDelete(index)}>Delete Row</button> <button onClick={this.handleDelete.bind(this, index)}>Delete Row</button> ~~~