Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wanjj_1210
ant-design
提交
852b28c2
A
ant-design
项目概览
wanjj_1210
/
ant-design
与 Fork 源项目一致
从无法访问的项目Fork
通知
10
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
ant-design
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
852b28c2
编写于
10月 12, 2020
作者:
X
xrk
提交者:
GitHub
10月 12, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
docs: update menu api (#27096)
* docs: update menu api * perf
上级
b64d02fd
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
27 addition
and
25 deletion
+27
-25
components/menu/demo/switch-mode.md
components/menu/demo/switch-mode.md
+1
-1
components/menu/demo/theme.md
components/menu/demo/theme.md
+2
-2
components/menu/index.en-US.md
components/menu/index.en-US.md
+12
-11
components/menu/index.zh-CN.md
components/menu/index.zh-CN.md
+12
-11
未找到文件。
components/menu/demo/switch-mode.md
浏览文件 @
852b28c2
...
...
@@ -11,7 +11,7 @@ title:
## en-US
Show the dynamic switching mode (between
'inline' and 'vertical'
).
Show the dynamic switching mode (between
`inline`
and
`vertical`
).
```
jsx
import
{
Menu
,
Switch
,
Divider
}
from
'
antd
'
;
...
...
components/menu/demo/theme.md
浏览文件 @
852b28c2
...
...
@@ -7,11 +7,11 @@ title:
## zh-CN
内建了两套主题
`light
|
dark`
,默认
`light`
。
内建了两套主题
`light
`
和
`
dark`
,默认
`light`
。
## en-US
There are two built-in themes:
'light' and 'dark'. The default value is 'light'
.
There are two built-in themes:
`light`
and
`dark`
. The default value is
`light`
.
```
jsx
import
{
Menu
,
Switch
}
from
'
antd
'
;
...
...
components/menu/index.en-US.md
浏览文件 @
852b28c2
...
...
@@ -34,21 +34,21 @@ More layouts with navigation: [Layout](/components/layout).
| forceSubMenuRender | Render submenu into DOM before it becomes visible | boolean | false | |
| inlineCollapsed | Specifies the collapsed status when menu is inline mode | boolean | - | |
| inlineIndent | Indent (in pixels) of inline menu items on each level | number | 24 | |
| mode | Type of menu
;
`vertical`
,
`horizontal`
, or
`inline`
|
`vertical`
\|
`horizontal`
\|
`inline`
|
`vertical`
| |
| mode | Type of menu |
`vertical`
\|
`horizontal`
\|
`inline`
|
`vertical`
| |
| multiple | Allows selection of multiple items | boolean | false | |
| onClick | Called when a menu item is clicked | function({ item, key, keyPath, domEvent }) | - | |
| onDeselect | Called when a menu item is deselected (multiple mode only) | function({ item, key, keyPath, selectedKeys, domEvent }) | - | |
| onOpenChange | Called when sub-menus are opened or closed | function(openKeys: string
\[
]) | - | |
| onSelect | Called when a menu item is selected | function({ item, key, keyPath, selectedKeys, domEvent }) | - | |
| openKeys | Array with the keys of currently opened sub-menus | string
\[
] | - | |
| overflowedIndicator | Customized icon when menu is collapsed | ReactNode | - | |
| selectable | Allows selecting menu items | boolean | true | |
| selectedKeys | Array with the keys of currently selected menu items | string
\[
] | - | |
| style | Style of the root node | CSSProperties | - | |
| subMenuCloseDelay | Delay time to hide submenu when mouse leaves (in seconds) | number | 0.1 | |
| subMenuOpenDelay | Delay time to show submenu when mouse enters, (in seconds) | number | 0 | |
| theme | Color theme of the menu |
`light`
\|
`dark`
|
`light`
| |
| onClick | Called when a menu item is clicked | function({ item, key, keyPath, domEvent }) | - | |
| onDeselect | Called when a menu item is deselected (multiple mode only) | function({ item, key, keyPath, selectedKeys, domEvent }) | - | |
| triggerSubMenuAction | Which action can trigger submenu open/close |
`hover`
\|
`click`
|
`hover`
| |
| onOpenChange | Called when sub-menus are opened or closed | function(openKeys: string
\[
]) | - | |
| onSelect | Called when a menu item is selected | function({ item, key, keyPath, selectedKeys, domEvent }) | - | |
| overflowedIndicator | Customized icon when menu is collapsed | ReactNode | - | |
> More options in [rc-menu](https://github.com/react-component/menu#api)
...
...
@@ -56,11 +56,11 @@ More layouts with navigation: [Layout](/components/layout).
| Param | Description | Type | Default value | Version |
| -------- | ------------------------------------ | --------- | ------------- | ------- |
| danger | Display the danger style | boolean | false | 4.3.0 |
| disabled | Whether menu item is disabled | boolean | false | |
| icon | The icon of the menu item | ReactNode | - | 4.2.0 |
| key | Unique ID of the menu item | string | - | |
| title | Set display title for collapsed item | string | - | |
| icon | The icon of the menu item | ReactNode | - | 4.2.0 |
| danger | Display the danger style | boolean | false | 4.3.0 |
> Note: `icon` is a newly added prop in`4.2.0`. For previous versions, please use the following method to define the icon.
>
...
...
@@ -85,13 +85,14 @@ More layouts with navigation: [Layout](/components/layout).
| Param | Description | Type | Default value | Version |
| --- | --- | --- | --- | --- |
| popupClassName | Sub-menu class name | string | - | |
| children | Sub-menus or sub-menu items | Array
<
MenuItem
\|
SubMenu> | - | |
| disabled | Whether sub-menu is disabled | boolean | false | |
| key | Unique ID of the sub-menu | string | - | |
| title | Title of sub menu | ReactNode | - | |
| icon | Icon of sub menu | ReactNode | - | 4.2.0 |
| key | Unique ID of the sub-menu | string | - | |
| onTitleClick | Callback executed when the sub-menu title is clicked | function({ key, domEvent }) | - | |
| popupClassName | Sub-menu class name | string | - | |
| popupOffset | Sub-menu offset |
\[
number, number] | - | |
| title | Title of sub menu | ReactNode | - | |
### Menu.ItemGroup
...
...
components/menu/index.zh-CN.md
浏览文件 @
852b28c2
...
...
@@ -37,31 +37,31 @@ cover: https://gw.alipayobjects.com/zos/alicdn/3XZcjGpvK/Menu.svg
| inlineIndent | inline 模式的菜单缩进宽度 | number | 24 | |
| mode | 菜单类型,现在支持垂直、水平、和内嵌模式三种 |
`vertical`
\|
`horizontal`
\|
`inline`
|
`vertical`
| |
| multiple | 是否允许多选 | boolean | false | |
| onClick | 点击 MenuItem 调用此函数 | function({ item, key, keyPath, domEvent }) | - | |
| onDeselect | 取消选中时调用,仅在 multiple 生效 | function({ item, key, keyPath, selectedKeys, domEvent }) | - | |
| onOpenChange | SubMenu 展开/关闭的回调 | function(openKeys: string
\[
]) | - | |
| onSelect | 被选中时调用 | function({ item, key, keyPath, selectedKeys, domEvent }) | - | |
| openKeys | 当前展开的 SubMenu 菜单项 key 数组 | string
\[
] | - | |
| overflowedIndicator | 自定义 Menu 折叠时的图标 | ReactNode | - | |
| selectable | 是否允许选中 | boolean | true | |
| selectedKeys | 当前选中的菜单项 key 数组 | string
\[
] | - | |
| style | 根节点样式 | CSSProperties | - | |
| subMenuCloseDelay | 用户鼠标离开子菜单后关闭延时,单位:秒 | number | 0.1 | |
| subMenuOpenDelay | 用户鼠标进入子菜单后开启延时,单位:秒 | number | 0 | |
| theme | 主题颜色 |
`light`
\|
`dark`
|
`light`
| |
| onClick | 点击 MenuItem 调用此函数 | function({ item, key, keyPath, domEvent }) | - | |
| onDeselect | 取消选中时调用,仅在 multiple 生效 | function({ item, key, keyPath, selectedKeys, domEvent }) | - | |
| triggerSubMenuAction | SubMenu 展开/关闭的触发行为 |
`hover`
\|
`click`
|
`hover`
| |
| onOpenChange | SubMenu 展开/关闭的回调 | function(openKeys: string
\[
]) | - | |
| onSelect | 被选中时调用 | function({ item, key, keyPath, selectedKeys, domEvent }) | - | |
| overflowedIndicator | 自定义 Menu 折叠时的图标 | ReactNode | - | |
>
More options in
[rc-menu](https://github.com/react-component/menu#api)
>
更多属性查看
[rc-menu](https://github.com/react-component/menu#api)
### Menu.Item
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| -------- | ------------------------ | --------- | ------ | ----- |
| danger | 展示错误状态样式 | boolean | false | 4.3.0 |
| disabled | 是否禁用 | boolean | false | |
| icon | 菜单图标 | ReactNode | - | 4.2.0 |
| key | item 的唯一标志 | string | - | |
| title | 设置收缩时展示的悬浮标题 | string | - | |
| icon | 菜单图标 | ReactNode | - | 4.2.0 |
| danger | 展示错误状态样式 | boolean | false | 4.3.0 |
> 注意:`icon` 是 `4.2.0` 新增的属性,之前的版本请使用下面的方式定义图标。
>
...
...
@@ -86,13 +86,14 @@ cover: https://gw.alipayobjects.com/zos/alicdn/3XZcjGpvK/Menu.svg
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| -------------- | -------------- | ----------------------------- | ------ | ----- |
| popupClassName | 子菜单样式 | string | - | |
| children | 子菜单的菜单项 | Array
<
MenuItem
\|
SubMenu> | - | |
| disabled | 是否禁用 | boolean | false | |
| key | 唯一标志 | string | - | |
| title | 子菜单项值 | ReactNode | - | |
| icon | 菜单图标 | ReactNode | - | 4.2.0 |
| key | 唯一标志 | string | - | |
| onTitleClick | 点击子菜单标题 | function({ key, domEvent }) | - | |
| popupClassName | 子菜单样式 | string | - | |
| popupOffset | 子菜单偏移量 |
\[
number, number] | - | |
| title | 子菜单项值 | ReactNode | - | |
### Menu.ItemGroup
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录