当前数据:
data:
[
{
"mainTableFieledName": "cross_address",
"tableFieldRealationType": "<",
"auxiliaryTableFieldName": "name"
},
{
"mainTableFieledName": "flag",
"tableFieldRealationType": ">",
"auxiliaryTableFieldName": "name"
}
]
select部分:
<Form.Item style={{ margin: 0 }}>
{form.getFieldDecorator(dataIndex, {
initialValue: { 这里如何写 ?} //这里如何写 ?
})(
<Select
className="table-user-name-input"
showSearch
placeholder="请选择"
optionFilterProp="children"
onChange={this.onChange}
labelInValue
filterOption={(input, option) =>
option.props.children
.toLowerCase()
.indexOf(input.toLowerCase()) >= 0
}
>
{tableFormData.map((item, index) => {
if (item.id.slice(-8) == connectFormData.nodeSourceId) {
return (
<Option key={index} value={index}>
{item.name}
</Option>
);
}
})}
</Select>
)}
</Form.Item>
请问, 如上 initialValue 部分如何写 ?
initialValue
只是设置初始值,用setFieldsValue
来设置回显的数据