ant-design/components/dropdown/demo/sub-menu.md

43 lines
821 B
Markdown
Raw Normal View History

2016-03-31 09:40:55 +08:00
---
order: 6
2016-07-04 10:48:21 +08:00
title:
zh-CN: 多级菜单
en-US: Cascading menu
2016-03-31 09:40:55 +08:00
---
2016-07-04 10:48:21 +08:00
## zh-CN
传入的菜单里有多个层级。
2016-07-04 10:48:21 +08:00
## en-US
The menu has multiple levels.
2017-02-13 10:55:53 +08:00
````jsx
import { Menu, Dropdown, Icon } from 'antd';
const SubMenu = Menu.SubMenu;
const menu = (
2017-05-11 16:48:40 +08:00
<Menu>
<Menu.Item>1st menu item</Menu.Item>
<Menu.Item>2nd menu item</Menu.Item>
<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" href="#">
Cascading menu <Icon type="down" />
</a>
</Dropdown>
, mountNode);
````