企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持知识库和私有化部署方案 广告
~~~ 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> ~~~