const renderAnswerDom = () => {
const answerDom = [];
for (let i = 0; i < 4; iPP) {
answerDom.push(
<FormItem label={`${i+1}`} key={i} {...formItemLayout}>
{
getFieldDecorator(`answerList[${i}].answer`, {
rules: [{required: true, message: "" }]
})(
<Input className="answer-input" placeholder=""/>
)
}
</FormItem>
)
}
return answerDom;
};
Quen = Form.create({
mapPropsToFields(props) {
if (!props.modifyData) return;
const formFileds = {};
formFileds.answerList = props.modifyData.answerDetailList.map(e => ({answer: Form.createFormField({ value: e.answer })}))
console.log(formFileds);
return formFileds;
}
})(Quen);