2016-03-31 09:40:55 +08:00
|
|
|
|
---
|
|
|
|
|
order: 2
|
2016-07-10 08:55:43 +08:00
|
|
|
|
title:
|
|
|
|
|
zh-CN: 多选
|
|
|
|
|
en-US: mutiple selection
|
2016-03-31 09:40:55 +08:00
|
|
|
|
---
|
2015-06-09 21:16:59 +08:00
|
|
|
|
|
2016-07-10 08:55:43 +08:00
|
|
|
|
## zh-CN
|
|
|
|
|
|
2015-06-15 17:17:23 +08:00
|
|
|
|
多选,从已有条目中选择(scroll the menu)
|
2015-06-09 21:16:59 +08:00
|
|
|
|
|
2016-07-10 08:55:43 +08:00
|
|
|
|
## en-US
|
|
|
|
|
|
|
|
|
|
Multiple selection, selecting from existing items (scroll the menu).
|
|
|
|
|
|
2015-06-09 21:16:59 +08:00
|
|
|
|
````jsx
|
2015-10-28 20:55:49 +08:00
|
|
|
|
import { Select } from 'antd';
|
|
|
|
|
const Option = Select.Option;
|
2015-06-09 21:16:59 +08:00
|
|
|
|
|
2015-10-28 20:55:49 +08:00
|
|
|
|
let children = [];
|
|
|
|
|
for (let i = 10; i < 36; i++) {
|
2015-07-08 22:07:15 +08:00
|
|
|
|
children.push(<Option key={i.toString(36) + i}>{i.toString(36) + i}</Option>);
|
2015-06-09 21:16:59 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function handleChange(value) {
|
2016-02-17 18:04:42 +08:00
|
|
|
|
console.log(`selected ${value}`);
|
2015-06-09 21:16:59 +08:00
|
|
|
|
}
|
|
|
|
|
|
2015-10-20 16:47:55 +08:00
|
|
|
|
ReactDOM.render(
|
2016-06-14 23:10:17 +08:00
|
|
|
|
<Select
|
|
|
|
|
multiple
|
2016-05-19 16:32:41 +08:00
|
|
|
|
style={{ width: '100%' }}
|
2016-04-27 20:44:36 +08:00
|
|
|
|
placeholder="Please select"
|
2016-06-14 23:10:17 +08:00
|
|
|
|
defaultValue={['a10', 'c12']}
|
|
|
|
|
onChange={handleChange}
|
2016-06-06 13:54:10 +08:00
|
|
|
|
>
|
2015-06-14 17:26:31 +08:00
|
|
|
|
{children}
|
|
|
|
|
</Select>
|
2015-12-29 12:08:58 +08:00
|
|
|
|
, mountNode);
|
2015-06-09 21:16:59 +08:00
|
|
|
|
````
|