2024-05-31 10:50:47 +08:00
|
|
|
import React from 'react';
|
|
|
|
import { Form, Input } from 'antd';
|
|
|
|
|
|
|
|
const App: React.FC = () => (
|
2024-05-31 14:46:22 +08:00
|
|
|
<>
|
|
|
|
<Form
|
|
|
|
name="layout-multiple-horizontal"
|
|
|
|
layout="horizontal"
|
|
|
|
labelCol={{ span: 4 }}
|
|
|
|
wrapperCol={{ span: 20 }}
|
|
|
|
>
|
|
|
|
<Form.Item label="horizontal" name="horizontal" rules={[{ required: true }]}>
|
|
|
|
<Input />
|
|
|
|
</Form.Item>
|
|
|
|
<Form.Item
|
|
|
|
layout="vertical"
|
|
|
|
label="vertical"
|
|
|
|
name="vertical"
|
|
|
|
rules={[{ required: true }]}
|
|
|
|
labelCol={{ span: 24 }}
|
|
|
|
wrapperCol={{ span: 24 }}
|
|
|
|
>
|
|
|
|
<Input />
|
|
|
|
</Form.Item>
|
|
|
|
</Form>
|
|
|
|
<br />
|
|
|
|
<Form
|
|
|
|
name="layout-multiple-vertical"
|
2024-05-31 10:50:47 +08:00
|
|
|
layout="vertical"
|
2024-05-31 14:46:22 +08:00
|
|
|
labelCol={{ span: 4 }}
|
|
|
|
wrapperCol={{ span: 20 }}
|
2024-05-31 10:50:47 +08:00
|
|
|
>
|
2024-05-31 14:46:22 +08:00
|
|
|
<Form.Item label="vertical" name="vertical" rules={[{ required: true }]}>
|
|
|
|
<Input />
|
|
|
|
</Form.Item>
|
|
|
|
<Form.Item
|
|
|
|
layout="horizontal"
|
|
|
|
label="horizontal"
|
|
|
|
name="horizontal"
|
|
|
|
rules={[{ required: true }]}
|
|
|
|
>
|
|
|
|
<Input />
|
|
|
|
</Form.Item>
|
|
|
|
</Form>
|
|
|
|
</>
|
2024-05-31 10:50:47 +08:00
|
|
|
);
|
|
|
|
|
|
|
|
export default App;
|