2023-03-05 21:00:06 +08:00
|
|
|
import React from 'react';
|
2024-04-08 14:04:08 +08:00
|
|
|
import { Cascader, Select, Space, TreeSelect, Typography } from 'antd';
|
2023-09-11 16:05:26 +08:00
|
|
|
|
|
|
|
const options = [
|
|
|
|
{ value: 'long', label: <Typography>long, long, long piece of text</Typography> },
|
|
|
|
{ value: 'short', label: <Typography>short</Typography> },
|
2023-09-18 13:51:17 +08:00
|
|
|
{ value: 'normal', label: <div>normal</div> },
|
2023-09-11 16:05:26 +08:00
|
|
|
];
|
2023-03-05 21:00:06 +08:00
|
|
|
|
|
|
|
const App: React.FC = () => (
|
|
|
|
<Space wrap>
|
|
|
|
<Select
|
|
|
|
defaultValue="long, long, long piece of text"
|
|
|
|
style={{ width: 120 }}
|
|
|
|
allowClear
|
2023-09-11 16:05:26 +08:00
|
|
|
options={options}
|
|
|
|
/>
|
|
|
|
|
|
|
|
<Select
|
|
|
|
placeholder="Select a option"
|
|
|
|
style={{ width: 120, height: 60 }}
|
|
|
|
allowClear
|
|
|
|
options={options}
|
|
|
|
/>
|
|
|
|
|
2023-09-18 13:51:17 +08:00
|
|
|
<Select
|
|
|
|
defaultValue="normal"
|
|
|
|
placeholder="Select a option"
|
|
|
|
style={{ width: 120 }}
|
|
|
|
allowClear
|
|
|
|
options={options}
|
|
|
|
/>
|
|
|
|
|
|
|
|
<Select
|
|
|
|
defaultValue={['normal']}
|
|
|
|
mode="multiple"
|
|
|
|
placeholder="Select a option"
|
|
|
|
style={{ width: 120 }}
|
|
|
|
allowClear
|
|
|
|
options={options}
|
|
|
|
/>
|
|
|
|
|
2023-09-11 16:05:26 +08:00
|
|
|
<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,
|
|
|
|
},
|
2023-03-05 21:00:06 +08:00
|
|
|
]}
|
|
|
|
/>
|
|
|
|
</Space>
|
|
|
|
);
|
|
|
|
|
|
|
|
export default App;
|