2
const [form] = useForm();
3
const getFieldErrors = () => {
4
console.log(form.validateFields());
6
const onFinish = (values) => {
9
const { Add, Trash } = KubeIcon;
11
<Form onFinish={onFinish} form={form}>
12
<FormList name="users">
13
{(fields, { add, remove }) => (
15
{fields.map(({ key, name, ...restField }) => (
16
<Row gutter={[10, 40]} key={key}>
20
name={[name, 'first']}
22
help="user name must input"
23
rules={[{ required: true, message: 'Please input your username!' }]}
34
rules={[{ required: true, message: 'Please input your uid!' }]}
40
<Button variant="text" onClick={() => remove(name)}>
48
<Button onClick={() => add()}>
56
<button type="button" onClick={getFieldErrors}>