【发布时间】:2015-11-13 15:15:28
【问题描述】:
在我的应用程序中,我有文本框列表。为了反映文本框中的变化,我正在调用 handleChange 函数调用。当我将第三个参数(索引)发送给函数时,e 值变得未定义。
HTML:
<div className="col-md-2">
<Input type="select" placeholder="select"
wrapperClassName="col-xs-12" value={this.props.lang}
onChange={this.handleChange.bind(this, 'language', index)}>
<option value="en">en</option>
<option value="de">de</option>
</Input>
</div>
致电:
handleChange(name, e) {
this.state.description[0][name] = e.target.value;
this.setState({description: this.state.description});
console.log('---updated--', this.state);
}
如何在 onChange 事件上向 handleChange 函数调用发送另一个参数?如何发送多个参数?
【问题讨论】:
标签: reactjs reactjs-flux