我的render
函数中有一个简单的表单,如下所示:
render : function() {
return (
<form>
<input type="text" name="email" placeholder="Email" />
<input type="password" name="password" placeholder="Password" />
<button type="button" onClick={this.handleLogin}>Login</button>
</form>
);
},
handleLogin: function() {
//How to access email and password here ?
}
要访问Email
和Password
字段,我应该在handleLogin: function() { ... }
中写入什么?
https://stackoverflow.com/questions/23427384
复制相似问题