mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-30 06:09:34 +08:00
3d76859bbc
* style: add dropdown group title rtl style * fix margin * fix lint
48 lines
951 B
Markdown
48 lines
951 B
Markdown
---
|
|
order: 6
|
|
title:
|
|
zh-CN: 多级菜单
|
|
en-US: Cascading menu
|
|
---
|
|
|
|
## zh-CN
|
|
|
|
传入的菜单里有多个层级。
|
|
|
|
## en-US
|
|
|
|
The menu has multiple levels.
|
|
|
|
```jsx
|
|
import { Menu, Dropdown } from 'antd';
|
|
import { DownOutlined } from '@ant-design/icons';
|
|
|
|
const { SubMenu } = Menu;
|
|
|
|
const menu = (
|
|
<Menu>
|
|
<Menu.ItemGroup title="Group title">
|
|
<Menu.Item>1st menu item</Menu.Item>
|
|
<Menu.Item>2nd menu item</Menu.Item>
|
|
</Menu.ItemGroup>
|
|
<SubMenu title="sub menu">
|
|
<Menu.Item>3rd menu item</Menu.Item>
|
|
<Menu.Item>4th menu item</Menu.Item>
|
|
</SubMenu>
|
|
<SubMenu title="disabled sub menu" disabled>
|
|
<Menu.Item>5d menu item</Menu.Item>
|
|
<Menu.Item>6th menu item</Menu.Item>
|
|
</SubMenu>
|
|
</Menu>
|
|
);
|
|
|
|
ReactDOM.render(
|
|
<Dropdown overlay={menu}>
|
|
<a className="ant-dropdown-link" onClick={e => e.preventDefault()}>
|
|
Cascading menu <DownOutlined />
|
|
</a>
|
|
</Dropdown>,
|
|
mountNode,
|
|
);
|
|
```
|