mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 19:19:57 +08:00
721 B
721 B
order | title | ||||
---|---|---|---|---|---|
21 |
|
zh-CN
使用 dropdownRender
对下拉菜单进行自由扩展。
en-US
Customize the dropdown menu via dropdownRender
.
import { Select, Icon, Divider } from 'antd';
const { Option } = Select;
ReactDOM.render(
<Select
defaultValue="lucy"
style={{ width: 120 }}
dropdownRender={menu => (
<div>
{menu}
<Divider style={{ margin: '4px 0' }} />
<div style={{ padding: '8px', cursor: 'pointer' }}>
<Icon type="plus" /> Add item
</div>
</div>
)}
>
<Option value="jack">Jack</Option>
<Option value="lucy">Lucy</Option>
</Select>,
mountNode,
);