mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-11-30 02:59:04 +08:00
092c79a6f3
* fix: Select align style broken with custom height * chore: fix AutoComplete demo
60 lines
1.3 KiB
TypeScript
60 lines
1.3 KiB
TypeScript
import React from 'react';
|
|
import { Select, Space, Cascader, Typography, TreeSelect } from 'antd';
|
|
|
|
const options = [
|
|
{ value: 'long', label: <Typography>long, long, long piece of text</Typography> },
|
|
{ value: 'short', label: <Typography>short</Typography> },
|
|
{ value: 'normal', label: 'normal' },
|
|
];
|
|
|
|
const App: React.FC = () => (
|
|
<Space wrap>
|
|
<Select
|
|
defaultValue="long, long, long piece of text"
|
|
style={{ width: 120 }}
|
|
allowClear
|
|
options={options}
|
|
/>
|
|
|
|
<Select
|
|
placeholder="Select a option"
|
|
style={{ width: 120, height: 60 }}
|
|
allowClear
|
|
options={options}
|
|
/>
|
|
|
|
<Select
|
|
mode="multiple"
|
|
placeholder="Select a option"
|
|
style={{ width: 120, height: 60 }}
|
|
allowClear
|
|
options={options}
|
|
/>
|
|
|
|
<Cascader
|
|
placeholder="Select a option"
|
|
style={{ width: 120, height: 60 }}
|
|
allowClear
|
|
options={options}
|
|
/>
|
|
|
|
<TreeSelect
|
|
showSearch
|
|
style={{ width: 120, height: 60 }}
|
|
placeholder="Please select"
|
|
allowClear
|
|
popupMatchSelectWidth={false}
|
|
treeDefaultExpandAll
|
|
treeData={[
|
|
{
|
|
value: 'parent 1',
|
|
title: 'parent 1',
|
|
children: options,
|
|
},
|
|
]}
|
|
/>
|
|
</Space>
|
|
);
|
|
|
|
export default App;
|