2015-06-09 21:16:59 +08:00
|
|
|
|
# 多选
|
|
|
|
|
|
2015-06-15 17:17:23 +08:00
|
|
|
|
- order: 2
|
2015-06-09 21:16:59 +08:00
|
|
|
|
|
2015-06-15 17:17:23 +08:00
|
|
|
|
多选,从已有条目中选择(scroll the menu)
|
2015-06-09 21:16:59 +08:00
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
````jsx
|
|
|
|
|
var Select = antd.Select;
|
|
|
|
|
var Option = Select.Option;
|
|
|
|
|
|
|
|
|
|
var children = [];
|
|
|
|
|
for (var 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) {
|
|
|
|
|
console.log('selected ' + value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
React.render(
|
2015-07-15 19:59:54 +08:00
|
|
|
|
<Select multiple
|
|
|
|
|
style={{width:400}}
|
|
|
|
|
value={['a10', 'c12']} onChange={handleChange}>
|
2015-06-14 17:26:31 +08:00
|
|
|
|
{children}
|
|
|
|
|
</Select>
|
2015-06-09 21:16:59 +08:00
|
|
|
|
, document.getElementById('components-select-demo-multiple'));
|
|
|
|
|
````
|