From fcd6add766a753cc89e426668783e16b299aa8c1 Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Thu, 9 Dec 2021 22:57:44 +0800 Subject: [PATCH] doc: submenu required key --- components/menu/index.en-US.md | 4 +++- components/menu/index.zh-CN.md | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/components/menu/index.en-US.md b/components/menu/index.en-US.md index 557af12b7..f60ded861 100644 --- a/components/menu/index.en-US.md +++ b/components/menu/index.en-US.md @@ -68,12 +68,14 @@ More layouts with navigation: [Layout](/components/layout). | -------------- | ----------------------------------- | ------------ | ------------- | ------- | | popupClassName | Sub-menu class name | string | | 1.5.0 | | disabled | whether sub menu is disabled or not | boolean | false | | -| key | Unique ID of the sub menu | string | | | +| key | Unique ID of the sub menu, required | string | | | | title | title of the sub menu | string\|slot | | | | expandIcon | Customized expandIcon | slot | arrow icon | | | The children of Menu.SubMenu must be `MenuItem` or `SubMenu`. +`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. + ### Menu.SubMenu Events | Events Name | Description | Arguments | diff --git a/components/menu/index.zh-CN.md b/components/menu/index.zh-CN.md index 51808e5ac..c29423731 100644 --- a/components/menu/index.zh-CN.md +++ b/components/menu/index.zh-CN.md @@ -69,13 +69,15 @@ cover: https://gw.alipayobjects.com/zos/alicdn/3XZcjGpvK/Menu.svg | -------------- | ------------------------ | ------------ | -------- | ----- | | popupClassName | 子菜单样式 | string | | 1.5.0 | | disabled | 是否禁用 | boolean | false | | -| key | 唯一标志 | string | | | +| key | 唯一标志, 必填 | string | | | | title | 子菜单项值 | string\|slot | | | | expandIcon | 自定义 Menu 展开收起图标 | slot | 箭头图标 | | | icon | 菜单图标 | slot | | 2.8.0 | Menu.SubMenu 的子元素必须是 `MenuItem` 或者 `SubMenu`. +`SubMenu` 必须传递 key,如不传递,该 SubMenu 下子元素将提前渲染,而且部分场景无法进行有效高亮。 + ### SubMenu 事件 | 事件名称 | 说明 | 回调参数 |