2016-03-31 09:40:55 +08:00
|
|
|
---
|
|
|
|
order: 5
|
2016-07-04 10:48:21 +08:00
|
|
|
title:
|
|
|
|
zh-CN: 多级菜单
|
|
|
|
en-US: Cascading menu
|
2016-03-31 09:40:55 +08:00
|
|
|
---
|
2015-12-31 17:34:04 +08:00
|
|
|
|
2016-07-04 10:48:21 +08:00
|
|
|
## zh-CN
|
|
|
|
|
2015-12-31 17:34:04 +08:00
|
|
|
传入的菜单里有多个层级。
|
|
|
|
|
2016-07-04 10:48:21 +08:00
|
|
|
## en-US
|
|
|
|
|
|
|
|
The menu has multiple levels.
|
|
|
|
|
2015-12-31 17:34:04 +08:00
|
|
|
````jsx
|
|
|
|
import { Menu, Dropdown, Icon } from 'antd';
|
|
|
|
const SubMenu = Menu.SubMenu;
|
|
|
|
|
2016-01-07 16:29:12 +08:00
|
|
|
const menu = (
|
|
|
|
<Menu>
|
|
|
|
<Menu.Item>第一个菜单项</Menu.Item>
|
|
|
|
<Menu.Item>第二个菜单项</Menu.Item>
|
|
|
|
<SubMenu title="子菜单">
|
|
|
|
<Menu.Item>第三个菜单项</Menu.Item>
|
|
|
|
<Menu.Item>第四个菜单项</Menu.Item>
|
|
|
|
</SubMenu>
|
|
|
|
</Menu>
|
|
|
|
);
|
2015-12-31 17:34:04 +08:00
|
|
|
|
|
|
|
ReactDOM.render(
|
|
|
|
<Dropdown overlay={menu}>
|
|
|
|
<a className="ant-dropdown-link" href="#">
|
|
|
|
多级菜单 <Icon type="down" />
|
|
|
|
</a>
|
|
|
|
</Dropdown>
|
|
|
|
, mountNode);
|
|
|
|
````
|