<TextArea rows={4} defaultValue={this.state.rcontent} ref="goodTextarea" placeholder="请填写内容..."/>
ref 标记
import ReactDOM from 'react-dom'
let value = ReactDOM.findDOMNode(this.refs['goodTextarea']).value;
<TextArea rows={4} defaultValue={this.state.rcontent} ref="goodTextarea" placeholder="请填写内容..."/>
ref 标记
import ReactDOM from 'react-dom'
let value = ReactDOM.findDOMNode(this.refs['goodTextarea']).value;
本文标题:react input 获取值
本文链接:https://www.haomeiwen.com/subject/swlbsftx.html
网友评论