[英]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.