0

如何将初始值传递给带有选择字段的表单 - React Final Form?

<Field className="input" name="pergunta_1" component="select">
<option>---</option>
<option>Sim</option>
<option>Não</option>
</Field>
4

1 回答 1

0

您可以遍历选项列表,如下所示:

 <Field className="input" name="pergunta_1" component="select">
 <option>---</option>

 {allFieldDisplay.map((each, index) => (
 <option value={each.fieldValue} key={index}>{each.fieldName}</option>
                  ))}

 </Field>
于 2019-01-17T04:19:50.443 回答