2016-03-31 09:40:55 +08:00
|
|
|
---
|
2017-02-09 15:09:32 +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
|
|
|
---
|
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.
|
|
|
|
|
2019-05-07 14:57:32 +08:00
|
|
|
```jsx
|
2019-08-13 14:07:17 +08:00
|
|
|
import { Menu, Dropdown } from 'antd';
|
2019-11-28 12:34:33 +08:00
|
|
|
import { DownOutlined } from '@ant-design/icons';
|
2018-06-27 15:55:04 +08:00
|
|
|
|
2019-05-06 12:04:39 +08:00
|
|
|
const { SubMenu } = Menu;
|
2015-12-31 17:34:04 +08:00
|
|
|
|
2016-01-07 16:29:12 +08:00
|
|
|
const menu = (
|
2017-05-11 16:48:40 +08:00
|
|
|
<Menu>
|
2020-04-21 10:49:59 +08:00
|
|
|
<Menu.ItemGroup title="Group title">
|
|
|
|
<Menu.Item>1st menu item</Menu.Item>
|
|
|
|
<Menu.Item>2nd menu item</Menu.Item>
|
|
|
|
</Menu.ItemGroup>
|
2016-09-29 11:51:24 +08:00
|
|
|
<SubMenu title="sub menu">
|
2017-10-18 00:20:33 +08:00
|
|
|
<Menu.Item>3rd menu item</Menu.Item>
|
2016-09-29 11:51:24 +08:00
|
|
|
<Menu.Item>4th menu item</Menu.Item>
|
2016-01-07 16:29:12 +08:00
|
|
|
</SubMenu>
|
2017-06-22 14:41:18 +08:00
|
|
|
<SubMenu title="disabled sub menu" disabled>
|
|
|
|
<Menu.Item>5d menu item</Menu.Item>
|
|
|
|
<Menu.Item>6th menu item</Menu.Item>
|
|
|
|
</SubMenu>
|
2016-01-07 16:29:12 +08:00
|
|
|
</Menu>
|
|
|
|
);
|
2015-12-31 17:34:04 +08:00
|
|
|
|
2022-04-03 23:27:45 +08:00
|
|
|
export default () => (
|
2015-12-31 17:34:04 +08:00
|
|
|
<Dropdown overlay={menu}>
|
2020-02-10 13:07:07 +08:00
|
|
|
<a className="ant-dropdown-link" onClick={e => e.preventDefault()}>
|
2019-11-28 12:34:33 +08:00
|
|
|
Cascading menu <DownOutlined />
|
2015-12-31 17:34:04 +08:00
|
|
|
</a>
|
2022-04-03 23:27:45 +08:00
|
|
|
</Dropdown>
|
2018-11-28 15:00:03 +08:00
|
|
|
);
|
2019-05-07 14:57:32 +08:00
|
|
|
```
|