From ce00829d858e84d18b12873dd1fc147435f5c75e Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Sat, 12 Mar 2022 10:33:04 +0800 Subject: [PATCH] doc: submenu popupOffset, close #5312 --- components/menu/index.en-US.md | 15 ++++++++------- components/menu/index.zh-CN.md | 17 +++++++++-------- components/menu/src/SubMenu.tsx | 2 +- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/components/menu/index.en-US.md b/components/menu/index.en-US.md index a6fcc9808..7283dbbc5 100644 --- a/components/menu/index.en-US.md +++ b/components/menu/index.en-US.md @@ -71,13 +71,14 @@ More layouts with navigation: [Layout](/components/layout). ### Menu.SubMenu -| Param | Description | Type | Default value | Version | -| -------------- | ----------------------------------- | ------------ | ------------- | ------- | -| disabled | whether sub menu is disabled or not | boolean | false | | -| expandIcon | Customized expandIcon | slot | arrow icon | | | -| key | Unique ID of the sub menu, required | string | | | -| popupClassName | Sub-menu class name | string | | 1.5.0 | -| title | title of the sub menu | string\|slot | | | +| Param | Description | Type | Default value | Version | +| --- | --- | --- | --- | --- | +| disabled | whether sub menu is disabled or not | boolean | false | | +| expandIcon | Customized expandIcon | slot | arrow icon | | | +| key | Unique ID of the sub menu, required | string | | | +| popupClassName | Sub-menu class name | string | | 1.5.0 | +| popupOffset | Sub-menu offset, not working when `mode="inline"` | \[number, number] | - | | +| title | title of the sub menu | string\|slot | | | The children of Menu.SubMenu must be `MenuItem` or `SubMenu`. diff --git a/components/menu/index.zh-CN.md b/components/menu/index.zh-CN.md index c7b1c677a..f03e4daf3 100644 --- a/components/menu/index.zh-CN.md +++ b/components/menu/index.zh-CN.md @@ -72,14 +72,15 @@ cover: https://gw.alipayobjects.com/zos/alicdn/3XZcjGpvK/Menu.svg ### Menu.SubMenu -| 参数 | 说明 | 类型 | 默认值 | 版本 | -| -------------- | ------------------------ | ------------ | -------- | ----- | -| disabled | 是否禁用 | boolean | false | | -| expandIcon | 自定义 Menu 展开收起图标 | slot | 箭头图标 | | -| icon | 菜单图标 | slot | | 2.8.0 | -| key | 唯一标志, 必填 | string | | | -| popupClassName | 子菜单样式 | string | | 1.5.0 | -| title | 子菜单项值 | string\|slot | | | +| 参数 | 说明 | 类型 | 默认值 | 版本 | +| -------------- | ------------------------------------ | ----------------- | -------- | ----- | +| disabled | 是否禁用 | boolean | false | | +| expandIcon | 自定义 Menu 展开收起图标 | slot | 箭头图标 | | +| icon | 菜单图标 | slot | | 2.8.0 | +| key | 唯一标志, 必填 | string | | | +| popupClassName | 子菜单样式 | string | | 1.5.0 | +| popupOffset | 子菜单偏移量,`mode="inline"` 时无效 | \[number, number] | - | | +| title | 子菜单项值 | string\|slot | | | Menu.SubMenu 的子元素必须是 `MenuItem` 或者 `SubMenu`. diff --git a/components/menu/src/SubMenu.tsx b/components/menu/src/SubMenu.tsx index bf0890b7d..cd313ce12 100644 --- a/components/menu/src/SubMenu.tsx +++ b/components/menu/src/SubMenu.tsx @@ -28,7 +28,7 @@ const subMenuProps = { disabled: Boolean, level: Number, popupClassName: String, - popupOffset: Array as PropType, + popupOffset: Array as unknown as PropType<[number, number]>, internalPopupClose: Boolean, eventKey: String, expandIcon: Function as PropType<(p?: { isOpen: boolean; [key: string]: any }) => any>,