ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、视频、阅读、搜索等,送10W Token,即刻开启你的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> ~~~