ant-design/components/dropdown/demo/basic.md
2022-04-22 13:35:27 +08:00

66 lines
1.2 KiB
Markdown

---
order: 0
title:
zh-CN: 基本
en-US: Basic
---
## zh-CN
最简单的下拉菜单。
## en-US
The most basic dropdown menu.
```jsx
import { Menu, Dropdown, Space } from 'antd';
import { DownOutlined, SmileOutlined } from '@ant-design/icons';
const menu = (
<Menu
items={[
{
label: (
<a target="_blank" rel="noopener noreferrer" href="https://www.antgroup.com">
1st menu item
</a>
),
},
{
label: (
<a target="_blank" rel="noopener noreferrer" href="https://www.aliyun.com">
2nd menu item (disabled)
</a>
),
icon: <SmileOutlined />,
disabled: true,
},
{
label: (
<a target="_blank" rel="noopener noreferrer" href="https://www.luohanacademy.com">
3rd menu item (disabled)
</a>
),
disabled: true,
},
{
danger: true,
label: 'a danger item',
},
]}
/>
);
export default () => (
<Dropdown overlay={menu}>
<a onClick={e => e.preventDefault()}>
<Space>
Hover me
<DownOutlined />
</Space>
</a>
</Dropdown>
);
```