第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

爲什麼提示target undefined啊

import React from "react";

class CommentBox extends React.Component {

constructor(props) {

super(props);

this.state = {

value: ""

};

}


handlechange(event) {

this.setState({ value: event.target.value })

}

handlesubmit(event) {

alert(this.state.value)

event.preventDefault()

}


render() {

return (

<form className="p-5" onSubmit={() => this.handlesubmit()}>

<div className="formgroup">

<label>留言內(nèi)容</label>

<input

type="text"

className="form-control"

placeholder="請輸入內(nèi)容"

value={this.state.value}

onChange={() => this.handlechange()}

/>

</div>

<button type="submit" className="btn btn-primary">

留言

</button>

</form>

);

}

}

export default CommentBox;


正在回答

4 回答

onChange={(event) => this.handlechange(event)},這個才對,上面有問題

1 回復 有任何疑惑可以回復我~

onChange={() => this.handlechange(event)},你的上個人也是這個問題

0 回復 有任何疑惑可以回復我~

沒有綁定到this實例, 可以這么寫 onChange={ this.handlechange.bind(this)}?

0 回復 有任何疑惑可以回復我~

onChange={ this.handlechange()}

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

爲什麼提示target undefined啊

我要回答 關(guān)注問題
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號