--- order: 13 title: zh-CN: 高级搜索 en-US: Advanced search --- ## zh-CN 三列栅格式的表单排列方式,常用于数据表格的高级搜索。 有部分定制的样式代码,由于输入标签长度不确定,需要根据具体情况自行调整。 ## en-US Three columns layout is often used for advanced searching of data table. Because the width of label is not fixed, you may need to adjust it by customizing its style. ```tsx import { Form, Row, Col, Input, Button, Icon } from 'antd'; const AdvancedSearchForm = () => { const [expand, setExpand] = React.useState(false); const [form] = Form.useForm(); const getFields = () => { const count = expand ? 10 : 6; const children = []; for (let i = 0; i < count; i++) { children.push( , ); } return children; }; const onFinish = values => { console.log('Received values of form: ', values); }; return (
{getFields()} { setExpand(!expand); }} > Collapse
); }; ReactDOM.render(
Search Result List
, mountNode, ); ``` ```css .ant-advanced-search-form { padding: 24px; background: #fbfbfb; border: 1px solid #d9d9d9; border-radius: 6px; } .ant-advanced-search-form .ant-form-item { display: flex; } .ant-advanced-search-form .ant-form-item-control-wrapper { flex: 1; } ```