[英]What is the difference 'Form.Item' and 'div' in antd?
我有个问题。 问题是关于'Form.Item'和'div'的区别。
我可以将标签“Form.Item”更改为“div”吗?
下面,我复制并粘贴 'Form.Item' 的 antd 文档。
import React, { useState, useEffect } from 'react';
import { Form, Input, Button } from 'antd';
import { UserOutlined, LockOutlined } from '@ant-design/icons';
const HorizontalLoginForm = () => {
const [form] = Form.useForm();
const [, forceUpdate] = useState();
// To disable submit button at the beginning.
useEffect(() => {
forceUpdate({});
}, []);
const onFinish = values => {
console.log('Finish:', values);
};
return (
<Form form={form} name="horizontal_login" layout="inline" onFinish={onFinish}>
<Form.Item <<<<<<<< here!!! Could i change the tag to 'div'? What is the difference both?
name="username"
rules={[{ required: true, message: 'Please input your username!' }]}
>
<Input prefix={<UserOutlined className="site-form-item-icon" />} placeholder="Username" />
</Form.Item> <<<<<<<< here!!! Could i change the tag to 'div'? What is the difference both?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.