react中获取input输入框内容的两种方法

一.经过event对象信息的方式web <input onChange={(e)=>this.inputChange(e)}/> <button onClick={()=>this.getInputValue} >获取input的值</button> inputChange(e){ alert(e.target.value) this.setState({ username:e.targ
相关文章
相关标签/搜索