mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-04 08:59:40 +08:00
73 lines
1.1 KiB
Markdown
73 lines
1.1 KiB
Markdown
---
|
|
order: 6
|
|
title:
|
|
zh-CN: 大小
|
|
en-US: Size
|
|
---
|
|
|
|
## zh-CN
|
|
|
|
不同大小的级联选择器。
|
|
|
|
## en-US
|
|
|
|
Cascade selection box of different sizes.
|
|
|
|
```jsx
|
|
import { Cascader } from 'antd';
|
|
|
|
const options = [
|
|
{
|
|
value: 'zhejiang',
|
|
label: 'Zhejiang',
|
|
children: [
|
|
{
|
|
value: 'hangzhou',
|
|
label: 'Hangzhou',
|
|
children: [
|
|
{
|
|
value: 'xihu',
|
|
label: 'West Lake',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
{
|
|
value: 'jiangsu',
|
|
label: 'Jiangsu',
|
|
children: [
|
|
{
|
|
value: 'nanjing',
|
|
label: 'Nanjing',
|
|
children: [
|
|
{
|
|
value: 'zhonghuamen',
|
|
label: 'Zhong Hua Men',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
];
|
|
|
|
function onChange(value) {
|
|
console.log(value);
|
|
}
|
|
|
|
ReactDOM.render(
|
|
<>
|
|
<Cascader size="large" options={options} onChange={onChange} />
|
|
<br />
|
|
<br />
|
|
<Cascader options={options} onChange={onChange} />
|
|
<br />
|
|
<br />
|
|
<Cascader size="small" options={options} onChange={onChange} />
|
|
<br />
|
|
<br />
|
|
</>,
|
|
mountNode,
|
|
);
|
|
```
|