2019-09-12 20:15:17 +08:00
|
|
|
---
|
|
|
|
order: 999
|
|
|
|
title:
|
|
|
|
zh-CN: 在 Form 中 Debug
|
|
|
|
en-US: Debug in Form
|
|
|
|
debug: true
|
|
|
|
---
|
|
|
|
|
2020-01-21 16:21:37 +08:00
|
|
|
```tsx
|
2019-11-28 12:34:33 +08:00
|
|
|
import { SearchOutlined } from '@ant-design/icons';
|
2022-05-21 22:14:15 +08:00
|
|
|
import { AutoComplete, Button, Form, Input, TreeSelect } from 'antd';
|
|
|
|
import React from 'react';
|
2019-09-12 20:15:17 +08:00
|
|
|
|
|
|
|
const formItemLayout = {
|
|
|
|
labelCol: {
|
|
|
|
xs: { span: 24 },
|
|
|
|
sm: { span: 8 },
|
|
|
|
},
|
|
|
|
wrapperCol: {
|
|
|
|
xs: { span: 24 },
|
|
|
|
sm: { span: 16 },
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
const App: React.FC = () => (
|
2020-05-09 19:32:02 +08:00
|
|
|
<Form style={{ margin: '0 auto' }} {...formItemLayout}>
|
|
|
|
<Form.Item label="单独 AutoComplete">
|
2019-09-12 20:15:17 +08:00
|
|
|
<AutoComplete />
|
|
|
|
</Form.Item>
|
2020-05-09 19:32:02 +08:00
|
|
|
<Form.Item label="单独 TreeSelect">
|
2019-09-12 20:15:17 +08:00
|
|
|
<TreeSelect />
|
|
|
|
</Form.Item>
|
2020-05-09 19:32:02 +08:00
|
|
|
<Form.Item label="添加 Input.Group 正常">
|
2019-09-12 20:15:17 +08:00
|
|
|
<Input.Group compact>
|
|
|
|
<TreeSelect style={{ width: '30%' }} />
|
|
|
|
<AutoComplete />
|
|
|
|
</Input.Group>
|
|
|
|
</Form.Item>
|
2020-05-09 19:32:02 +08:00
|
|
|
<Form.Item label="包含 search 图标正常">
|
2019-09-12 20:15:17 +08:00
|
|
|
<AutoComplete>
|
2019-11-28 12:34:33 +08:00
|
|
|
<Input suffix={<SearchOutlined />} />
|
2019-09-12 20:15:17 +08:00
|
|
|
</AutoComplete>
|
|
|
|
</Form.Item>
|
2020-05-09 19:32:02 +08:00
|
|
|
<Form.Item label="同时有 Input.Group 和图标发生移位">
|
2019-09-12 20:15:17 +08:00
|
|
|
<Input.Group compact>
|
|
|
|
<TreeSelect style={{ width: '30%' }} />
|
|
|
|
<AutoComplete>
|
2019-11-28 12:34:33 +08:00
|
|
|
<Input suffix={<SearchOutlined />} />
|
2019-09-12 20:15:17 +08:00
|
|
|
</AutoComplete>
|
|
|
|
</Input.Group>
|
|
|
|
</Form.Item>
|
2020-05-09 19:32:02 +08:00
|
|
|
<Form.Item label="同时有 Input.Group 和 Search 组件发生移位">
|
2019-09-12 20:15:17 +08:00
|
|
|
<Input.Group compact>
|
|
|
|
<TreeSelect style={{ width: '30%' }} />
|
|
|
|
<AutoComplete>
|
|
|
|
<Input.Search />
|
|
|
|
</AutoComplete>
|
|
|
|
</Input.Group>
|
|
|
|
</Form.Item>
|
2020-05-09 19:32:02 +08:00
|
|
|
<Form.Item label="Input Group 和 Button 结合">
|
2019-12-21 22:01:47 +08:00
|
|
|
<Input.Group compact>
|
|
|
|
<TreeSelect style={{ width: '20%' }} />
|
|
|
|
<AutoComplete>
|
|
|
|
<Input.Search />
|
|
|
|
</AutoComplete>
|
|
|
|
<Button type="primary" icon={<SearchOutlined />}>
|
|
|
|
Search
|
|
|
|
</Button>
|
|
|
|
</Input.Group>
|
|
|
|
</Form.Item>
|
2022-04-03 23:27:45 +08:00
|
|
|
</Form>
|
2019-09-12 20:15:17 +08:00
|
|
|
);
|
2022-05-19 09:46:26 +08:00
|
|
|
|
|
|
|
export default App;
|
2019-09-12 20:15:17 +08:00
|
|
|
```
|