-
-
Notifications
You must be signed in to change notification settings - Fork 280
Closed
Description
如antdesign里的设置带namepath的值,参考这个issue:
ant-design/ant-design#34863
What problem does this feature solve?
如Form.List导致的name path.
const [form] = useForm();
...
<Form form={form}>
<Form.List>
{
fields => {
return fields.map(field => {
return <Form.Item name=[field.name, 'userName']><Input /></Form.Item>
})
}
}
</Form.List>
<Form>
form.setFieldsValue 这个api由于只能传Record<string, any> ,没法做到 处理NamePath是 (string|number)[] 类型的情况
What does the proposed API look like?
form.setFieldsValue((): [NamePath, Value][] => {
return [
[[field.name, 'userName'], 'XiaoMing'],
[[field.name, 'gender'], 'Male'],
];
})
Metadata
Metadata
Assignees
Labels
No labels