submit=(e)=>{
e.preventDefault();
let value=this.props.form.getFieldValue('key')+this.props.from.getFieldValue('replytext');
alert(value);
}
render() {
const { getFieldProps } = this.props.form;
return (
<div className="createreply-container">
<WhiteSpace />
<WhiteSpace />
<form onSubmit={this.submit}>
<WingBlank>
<List renderHeader={() => '关键词'}>
<InputItem
{...getFieldProps('key')}
placeholder="请输入关键字"
/>
</List>
</WingBlank>
<WhiteSpace />
<WingBlank>
<List renderHeader={() => '回复内容'}>
<TextareaItem
{...getFieldProps('replytext', {
// initialValue: '请输入回复内容...',
})}
placeholder="请输入回复内容"
rows={5}
count={100}
/>
</List>
</WingBlank>
<WhiteSpace />
<WingBlank>
</WingBlank>
<WhiteSpace size="lg"/>
<WingBlank>
<Button type="primary" onClick={this.submit}>完成</Button>
</WingBlank>
</form>
部分代码
出错:
相关分类