//value是可变的,input要加上onChange事件 <input type="text" value={this.state.userName} onChange={this.handleChange}/>handleChange=(e)=>{ this.setState({ userName:e.target.value }) }