ant-design/components/form/demo/layout-multiple.tsx
叶枫 5932005ce4
Form.Item support layout (#49119)
* feat: FormItem support layout

* feat: doc

* feat: test

* feat: test

* feat: test

* feat: test

* feat: itemPrefixCls
2024-05-31 10:50:47 +08:00

23 lines
574 B
TypeScript

import React from 'react';
import { Form, Input } from 'antd';
const App: React.FC = () => (
<Form name="layout-multiple" layout="horizontal" labelCol={{ span: 4 }} wrapperCol={{ span: 20 }}>
<Form.Item label="name" name="name" rules={[{ required: true }]}>
<Input />
</Form.Item>
<Form.Item
layout="vertical"
label="loooooooooooooooooooooooooooooooong"
name="age"
rules={[{ required: true }]}
labelCol={{ span: 24 }}
wrapperCol={{ span: 24 }}
>
<Input />
</Form.Item>
</Form>
);
export default App;