ant-design/components/select/demo/multiple.md
2015-06-09 21:16:59 +08:00

43 lines
732 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 多选
- order: 1
多选
---
````jsx
var Select = antd.Select;
var Option = Select.Option;
var children = [];
for (var i = 10; i < 36; i++) {
children.push(<Option value={i.toString(36) + i}>{i.toString(36) + i}</Option>);
}
function handleChange(value) {
console.log('selected ' + value);
}
var style = '.rc-select-menu {max-height:200px;overflow:auto;}';
var c2 = (
<div>
<h1>multiple selectscroll the menu</h1>
<div style={{width: 300}}>
<style>
{style}
</style>
<Select multiple value={['name2', 'name3']} onChange={handleChange}>
{children}
</Select>
</div>
</div>
);
React.render(
c2
, document.getElementById('components-select-demo-multiple'));
````