Skip to content

Commit fcd6add

Browse files
committed
doc: submenu required key
1 parent 95a1b4a commit fcd6add

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

components/menu/index.en-US.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,14 @@ More layouts with navigation: [Layout](/components/layout).
6868
| -------------- | ----------------------------------- | ------------ | ------------- | ------- |
6969
| popupClassName | Sub-menu class name | string | | 1.5.0 |
7070
| disabled | whether sub menu is disabled or not | boolean | false | |
71-
| key | Unique ID of the sub menu | string | | |
71+
| key | Unique ID of the sub menu, required | string | | |
7272
| title | title of the sub menu | string\|slot | | |
7373
| expandIcon | Customized expandIcon | slot | arrow icon ||
7474

7575
The children of Menu.SubMenu must be `MenuItem` or `SubMenu`.
7676

77+
`SubMenu` must pass the key. If it is not passed, the sub-elements under the SubMenu will be rendered in advance, and some scenes cannot be effectively highlighted.
78+
7779
### Menu.SubMenu Events
7880

7981
| Events Name | Description | Arguments |

components/menu/index.zh-CN.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,15 @@ cover: https://gw.alipayobjects.com/zos/alicdn/3XZcjGpvK/Menu.svg
6969
| -------------- | ------------------------ | ------------ | -------- | ----- |
7070
| popupClassName | 子菜单样式 | string | | 1.5.0 |
7171
| disabled | 是否禁用 | boolean | false | |
72-
| key | 唯一标志 | string | | |
72+
| key | 唯一标志, 必填 | string | | |
7373
| title | 子菜单项值 | string\|slot | | |
7474
| expandIcon | 自定义 Menu 展开收起图标 | slot | 箭头图标 | |
7575
| icon | 菜单图标 | slot | | 2.8.0 |
7676

7777
Menu.SubMenu 的子元素必须是 `MenuItem` 或者 `SubMenu`.
7878

79+
`SubMenu` 必须传递 key,如不传递,该 SubMenu 下子元素将提前渲染,而且部分场景无法进行有效高亮。
80+
7981
### SubMenu 事件
8082

8183
| 事件名称 | 说明 | 回调参数 |

0 commit comments

Comments
 (0)