以input事宜为例:
html代码:
<Input
placeholder="电子邮箱"
value={this.state.addEmail}
onChange={this.addInputChange}
onBlur={this.checkEmail.bind(this,'flagAddEmail')}
/>
注重末了一行,bind的参数为(this,‘你要传的参数’)
js代码怎样吸收参数:
checkEmail(name,evt) {
console.log(name); //flagAddEmail
console.log(evt.target.value); //input中输入的值
}