JGuang

导航菜单

Menu · Ant Design

交互预览
npm install antd@6.6.5 @ant-design/icons@6.3.4 dayjs@1.11.23

导航菜单

为页面和功能提供导航的菜单列表。

何时使用

导航菜单是一个网站的灵魂,用户依赖导航在各个页面中进行跳转。一般分为顶部导航和侧边导航,顶部导航提供全局性的类目和功能,侧边导航提供多级结构来收纳和排列网站架构。

更多布局和导航的使用可以参考:通用布局。

开发者注意事项

  • Menu 元素为 ul,因而仅支持 li 以及 script-supporting 子元素。因而你的子节点元素应该都在 Menu.Item 内使用。
  • Menu 需要计算节点结构,因而其子元素仅支持 Menu.* 以及对此进行封装的 HOC 组件。

代码演示

  • 顶部导航 · horizontal

  • 内嵌菜单 · inline

  • 缩起内嵌菜单 · inline-collapsed

  • 菜单项提示 · tooltip

  • 只展开当前父级菜单 · sider-current

  • 垂直菜单 · vertical

  • 主题 · theme

  • 子菜单主题 · submenu-theme

  • 切换菜单类型 · switch-mode

  • 自定义语义结构的样式和类 · style-class

  • 自定义弹出框 · custom-popup-render

API

通用属性参考:通用属性

参数说明类型默认值版本全局配置
classNames用于自定义组件内部各语义化结构的 class,支持对象或函数Record<SemanticDOM, string> | (info: { props }) => Record<SemanticDOM, string>-6.0.0
defaultOpenKeys初始展开的 SubMenu 菜单项 key 数组string[]-×
defaultSelectedKeys初始选中的菜单项 key 数组string[]-×
expandIcon自定义展开图标ReactNode | (props: SubMenuProps & { isSubMenu: boolean }) => ReactNode-4.9.05.15.0
forceSubMenuRender在子菜单展示之前就渲染进 DOMbooleanfalse×
inlineCollapsedinline 时菜单是否收起状态boolean-×
inlineIndentinline 模式的菜单缩进宽度number24×
items菜单内容ItemType[]-4.20.0×
mode菜单类型,现在支持垂直、水平、和内嵌模式三种vertical | horizontal | inlinevertical×
multiple是否允许多选booleanfalse×
openKeys当前展开的 SubMenu 菜单项 key 数组string[]-×
overflowedIndicator用于自定义 Menu 水平空间不足时的省略收缩的图标ReactNode<EllipsisOutlined />×
selectable是否允许选中booleantrue×
selectedKeys当前选中的菜单项 key 数组string[]-×
styles用于自定义组件内部各语义化结构的行内 style,支持对象或函数Record<SemanticDOM , CSSProperties> | (info: { props }) => Record<SemanticDOM , CSSProperties>-6.0.0
subMenuCloseDelay用户鼠标离开子菜单后关闭延时,单位:秒number0.1×
subMenuOpenDelay用户鼠标进入子菜单后开启延时,单位:秒number0×
tooltip配置 inline 折叠时的 MenuItem 悬浮提示,设为 false 可关闭false | TooltipProps-6.3.0×
theme主题颜色light | darklight×
triggerSubMenuActionSubMenu 展开/关闭的触发行为hover | clickhover×
onClick点击 MenuItem 调用此函数function({ key, keyPath, domEvent, itemData })-×
onDeselect取消选中时调用,仅在 multiple 生效function({ key, keyPath, selectedKeys, domEvent, itemData })-×
onOpenChangeSubMenu 展开/关闭的回调function(openKeys: string[])-×
onSelect被选中时调用function({ key, keyPath, selectedKeys, domEvent, itemData })-×
popupRender自定义子菜单的弹出框(node: ReactElement, props: { item: SubMenuProps; keys: string[] }) => ReactNode-×

更多属性查看 @rc-component/menu

ItemType

type ItemType = MenuItemType | SubMenuType | MenuItemGroupType | MenuDividerType;

参数说明类型默认值版本
danger展示错误状态样式booleanfalse
disabled是否禁用booleanfalse
extra额外节点ReactNode-5.21.0
icon菜单图标ReactNode-
keyitem 的唯一标志string-
label菜单项标题ReactNode-
title设置收缩时展示的悬浮标题string-
参数说明类型默认值版本
children子菜单的菜单项ItemType[]-
disabled是否禁用booleanfalse
icon菜单图标ReactNode-
key唯一标志string-
label菜单项标题ReactNode-
popupClassName子菜单样式,mode="inline" 时无效string-
popupOffset子菜单偏移量,mode="inline" 时无效[number, number]-
theme设置子菜单的主题,默认从 Menu 上继承light | dark-
onTitleClick点击子菜单标题function({ key, domEvent })-
popupRender自定义当前子菜单的弹出框(node: ReactElement, props: { item: SubMenuProps; keys: string[] }) => ReactNode-

定义类型为 group 时,会作为分组处理:

const groupItem = {
  type: 'group', // Must have
  label: 'My Group',
  children: [],
};
参数说明类型默认值版本
children分组的菜单项MenuItemType[]-
label分组标题ReactNode-

菜单项分割线,只用在弹出菜单内,需要定义类型为 divider:

const dividerItem = {
  type: 'divider', // Must have
};
参数说明类型默认值版本
dashed是否虚线booleanfalse

FAQ

为何 Menu 的子元素会渲染两次?

Menu 通过二次渲染收集嵌套结构信息以支持 HOC 的结构。合并成一个推导结构会使得逻辑变得十分复杂,欢迎 PR 以协助改进该设计。

在 Flex 布局中,Menu 没有按照预期响应式省略菜单?

Menu 初始化时会先全部渲染,然后根据宽度裁剪内容。当处于 Flex 布局中,你需要告知其预期宽度为响应式宽度(在线 Demo):

<div style={{ flex }}>
  <div style={{ ... }}>Some Content</div>
  <Menu style={{ minWidth: 0, flex: "auto" }} />
</div>

Semantic DOM

语义节点原生说明版本
root根元素,包含菜单容器的基础样式和布局—
item条目元素,包含相对定位、块级显示、外边距、空白符处理、光标样式、过渡动画等菜单项的基础交互样式—
itemIcon图标元素,包含最小宽度、字体大小、过渡动画、图标重置样式,以及与文本的间距控制—
itemContent条目内容元素,包含菜单项内容的布局和排版样式—
subMenu.itemTitle子菜单标题元素,包含子菜单标题的样式和交互效果—
subMenu.list子菜单列表元素,包含子菜单列表的布局和容器样式—
subMenu.item子菜单单项元素,包含子菜单项的样式和交互效果—
subMenu.itemIcon子菜单条目图标元素,包含子菜单图标的尺寸和样式—
subMenu.itemContent子菜单条目内容元素,包含子菜单内容的布局和排版—
itemTitle菜单标题元素(horizontal 模式不生效),包含标题文字的样式和布局—
list菜单列表元素(horizontal 模式不生效),包含菜单列表的布局和容器样式—
popup弹出菜单(inline 模式不生效),包含弹出层的定位、层级、背景等样式—

语义说明来源: vendor/components/menu/demo/_semantic.tsx

主题变量(Design Token)

类型、继承关系和原生令牌声明保持固定源码原文;默认值由原生主题计算,并可能受 ConfigProvider 覆盖。本表不伪造静态默认值。

令牌类型原生说明
dropdownWidthnumber | string弹出菜单的宽度
zIndexPopupnumber弹出菜单的 z-index
colorGroupTitlestring见原生声明及继承类型
groupTitleColorstring分组标题文字颜色
groupTitleLineHeightstring | number分组标题文字高度
groupTitleFontSizenumber分组标题文字大小
radiusItemnumber见原生声明及继承类型
itemBorderRadiusnumber菜单项的圆角
radiusSubMenuItemnumber见原生声明及继承类型
subMenuItemBorderRadiusnumber子菜单项的圆角
colorItemTextstring见原生声明及继承类型
itemColorstring菜单项文字颜色
colorItemTextHoverstring见原生声明及继承类型
itemHoverColorstring菜单项文字悬浮颜色
colorItemTextHoverHorizontalstring见原生声明及继承类型
horizontalItemHoverColorstring水平菜单项文字悬浮颜色
colorItemTextSelectedstring见原生声明及继承类型
itemSelectedColorstring菜单项文字选中颜色
subMenuItemSelectedColorstring子菜单内有选中项时,子菜单标题色
colorItemTextSelectedHorizontalstring见原生声明及继承类型
horizontalItemSelectedColorstring水平菜单项文字选中颜色
colorItemTextDisabledstring见原生声明及继承类型
itemDisabledColorstring菜单项文字禁用颜色
colorDangerItemTextstring见原生声明及继承类型
dangerItemColorstring危险菜单项文字颜色
colorDangerItemTextHoverstring见原生声明及继承类型
dangerItemHoverColorstring危险菜单项文字悬浮颜色
colorDangerItemTextSelectedstring见原生声明及继承类型
dangerItemSelectedColorstring危险菜单项文字选中颜色
colorDangerItemBgActivestring见原生声明及继承类型
dangerItemActiveBgstring危险菜单项激活态背景色
colorDangerItemBgSelectedstring见原生声明及继承类型
dangerItemSelectedBgstring危险菜单项选中背景色
colorItemBgstring见原生声明及继承类型
itemBgstring菜单项背景色
colorItemBgHoverstring见原生声明及继承类型
itemHoverBgstring菜单项悬浮态背景色
colorSubItemBgstring见原生声明及继承类型
subMenuItemBgstring子菜单项背景色
colorItemBgActivestring见原生声明及继承类型
itemActiveBgstring菜单项激活态背景色
colorItemBgSelectedstring见原生声明及继承类型
itemSelectedBgstring菜单项选中态背景色
colorItemBgSelectedHorizontalstring见原生声明及继承类型
horizontalItemSelectedBgstring水平菜单项选中态背景色
colorActiveBarWidthnumber | string见原生声明及继承类型
activeBarWidthnumber | string菜单项指示条宽度
colorActiveBarHeightnumber见原生声明及继承类型
activeBarHeightnumber菜单项指示条高度
colorActiveBarBorderSizenumber见原生声明及继承类型
activeBarBorderWidthnumber | string菜单项指示条边框宽度
itemMarginInlinenumber菜单项横向外间距
horizontalItemHoverBgstring横向菜单项横悬浮态背景色
horizontalItemBorderRadiusnumber横向菜单项圆角
itemHeightnumber | string菜单项高度
collapsedWidthnumber | string收起后的宽度
popupBgstring弹出框背景色
itemMarginBlockCSSProperties['marginBlock']菜单项纵向外间距
itemPaddingInlineCSSProperties['paddingInline']菜单项横向内间距
horizontalLineHeightCSSProperties['lineHeight']横向菜单行高
iconMarginInlineEndCSSProperties['marginInlineEnd']图标与文字间距
iconSizenumber图标尺寸
collapsedIconSizenumber收起时图标尺寸
darkPopupBgstring暗色模式下的浮层菜单的背景颜色
darkItemColorstring暗色模式下的菜单项文字颜色
darkDangerItemColorstring暗色模式下的危险菜单项文字颜色
darkItemBgstring暗色模式下的菜单项背景
darkSubMenuItemBgstring暗色模式下的子菜单项背景
darkItemSelectedColorstring暗色模式下的菜单项选中颜色
darkItemSelectedBgstring暗色模式下的菜单项选中背景
darkItemHoverBgstring暗色模式下的菜单项悬浮背景
darkGroupTitleColorstring暗色模式下的分组标题文字颜色
darkItemHoverColorstring暗色模式下的菜单项悬浮颜色
darkItemDisabledColorstring暗色模式下的菜单项禁用颜色
darkDangerItemSelectedBgstring暗色模式下的危险菜单项选中背景
darkDangerItemHoverColorstring暗色模式下的危险菜单项悬浮文字背景
darkDangerItemSelectedColorstring暗色模式下的危险菜单项选中文字颜色
darkDangerItemActiveBgstring暗色模式下的危险菜单项激活态背景
itemWidthnumber | string见原生声明及继承类型

声明来源: vendor/components/menu/style/index.ts

import type { CSSProperties } from 'react';

import type { CSSObject } from '@ant-design/cssinjs';

import { unit } from '@ant-design/cssinjs';

import { FastColor } from '@ant-design/fast-color';

import type { CssUtil } from 'antd-style';

import { clearFix, resetComponent, resetIcon, textEllipsis } from '../../style';

import { genCollapseMotion, initSlideMotion, initZoomMotion } from '../../style/motion';

import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal';

import { genStyleHooks, mergeToken } from '../../theme/internal';

import getHorizontalStyle from './horizontal';

import getRTLStyle from './rtl';

import getThemeStyle from './theme';

import getVerticalStyle from './vertical';

/** Component only token. Which will handle additional calculation of alias token */
export interface ComponentToken {
  /**
   * @desc 弹出菜单的宽度
   * @descEN Width of popup menu
   */
  dropdownWidth: number | string;
  /**
   * @desc 弹出菜单的 z-index
   * @descEN z-index of popup menu
   */
  zIndexPopup: number;

  // Group
  /** @deprecated Use `groupTitleColor` instead */
  colorGroupTitle: string;
  /**
   * @desc 分组标题文字颜色
   * @descEN Color of group title text
   */
  groupTitleColor: string;
  /**
   * @desc 分组标题文字高度
   * @descEN line-height of group title
   */
  groupTitleLineHeight: string | number;
  /**
   * @desc 分组标题文字大小
   * @descEN font-size of group title
   */
  groupTitleFontSize: number;

  // radius
  /** @deprecated Use `itemBorderRadius` instead */
  radiusItem: number;
  /**
   * @desc 菜单项的圆角
   * @descEN Radius of menu item
   */
  itemBorderRadius: number;

  /** @deprecated Use `subMenuItemBorderRadius` instead */
  radiusSubMenuItem: number;
  /**
   * @desc 子菜单项的圆角
   * @descEN Radius of sub-menu item
   */
  subMenuItemBorderRadius: number;

  // Item Text
  // > Default
  /** @deprecated Use `itemColor` instead */
  colorItemText: string;
  /**
   * @desc 菜单项文字颜色
   * @descEN Color of menu item text
   */
  itemColor: string;

  /** @deprecated Use `itemHoverColor` instead */
  colorItemTextHover: string;
  /**
   * @desc 菜单项文字悬浮颜色
   * @descEN Hover color of menu item text
   */
  itemHoverColor: string;

  /** @deprecated Use `horizontalItemHoverColor` instead */
  colorItemTextHoverHorizontal: string;
  /**
   * @desc 水平菜单项文字悬浮颜色
   * @descEN Hover color of horizontal menu item text
   */
  horizontalItemHoverColor: string;

  /** @deprecated Use `itemSelectedColor` instead */
  colorItemTextSelected: string;
  /**
   * @desc 菜单项文字选中颜色
   * @descEN Color of selected menu item text
   */
  itemSelectedColor: string;
  /**
   * @desc 子菜单内有选中项时,子菜单标题色
   * @descEN Color of submenu title when submenu has selected item
   */
  subMenuItemSelectedColor: string;

  /** @deprecated Use `horizontalItemSelectedColor` instead */
  colorItemTextSelectedHorizontal: string;
  /**
   * @desc 水平菜单项文字选中颜色
   * @descEN Color of selected horizontal menu item text
   */
  horizontalItemSelectedColor: string;

  // > Disabled
  /** @deprecated Use `itemDisabledColor` instead */
  colorItemTextDisabled: string;
  /**
   * @desc 菜单项文字禁用颜色
   * @descEN Color of disabled menu item text
   */
  itemDisabledColor: string;

  // > Danger
  /** @deprecated Use `dangerItemColor` instead */
  colorDangerItemText: string;
  /**
   * @desc 危险菜单项文字颜色
   * @descEN Color of danger menu item text
   */
  dangerItemColor: string;

  /** @deprecated Use `dangerItemHoverColor` instead */
  colorDangerItemTextHover: string;
  /**
   * @desc 危险菜单项文字悬浮颜色
   * @descEN Hover color of danger menu item text
   */
  dangerItemHoverColor: string;

  /** @deprecated Use `dangerItemSelectedColor` instead */
  colorDangerItemTextSelected: string;
  /**
   * @desc 危险菜单项文字选中颜色
   * @descEN Color of selected danger menu item text
   */
  dangerItemSelectedColor: string;

  /** @deprecated Use `dangerItemActiveBg` instead */
  colorDangerItemBgActive: string;
  /**
   * @desc 危险菜单项激活态背景色
   * @descEN Background color of danger menu item when active
   */
  dangerItemActiveBg: string;

  /** @deprecated Use `dangerItemSelectedBg` instead */
  colorDangerItemBgSelected: string;
  /**
   * @desc 危险菜单项选中背景色
   * @descEN Background color of selected danger menu item
   */
  dangerItemSelectedBg: string;

  // Item Bg
  /** @deprecated Use `itemBg` instead */
  colorItemBg: string;
  /**
   * @desc 菜单项背景色
   */
  itemBg: string;

  /** @deprecated Use `itemHoverBg` instead */
  colorItemBgHover: string;
  /**
   * @desc 菜单项悬浮态背景色
   * @descEN Background color of menu item when hover
   */
  itemHoverBg: string;

  /** @deprecated Use `subMenuItemBg` instead */
  colorSubItemBg: string;
  /**
   * @desc 子菜单项背景色
   * @descEN Background color of sub-menu item
   */
  subMenuItemBg: string;

  // > Default
  /** @deprecated Use `itemActiveBg` instead */
  colorItemBgActive: string;
  /**
   * @desc 菜单项激活态背景色
   * @descEN Background color of menu item when active
   */
  itemActiveBg: string;

  /** @deprecated Use `itemSelectedBg` instead */
  colorItemBgSelected: string;
  /**
   * @desc 菜单项选中态背景色
   * @descEN Background color of menu item when selected
   */
  itemSelectedBg: string;

  /** @deprecated Use `horizontalItemSelectedBg` instead */
  colorItemBgSelectedHorizontal: string;
  /**
   * @desc 水平菜单项选中态背景色
   * @descEN Background color of horizontal menu item when selected
   */
  horizontalItemSelectedBg: string;

  // Ink Bar
  /** @deprecated Use `activeBarWidth` instead */
  colorActiveBarWidth: number | string;
  /**
   * @desc 菜单项指示条宽度
   * @descEN Width of menu item active bar
   */
  activeBarWidth: number | string;

  /** @deprecated Use `activeBarHeight` instead */
  colorActiveBarHeight: number;
  /**
   * @desc 菜单项指示条高度
   * @descEN Height of menu item active bar
   */
  activeBarHeight: number;

  /** @deprecated Use `activeBarBorderWidth` instead */
  colorActiveBarBorderSize: number;
  /**
   * @desc 菜单项指示条边框宽度
   * @descEN Border width of menu item active bar
   */
  activeBarBorderWidth: number | string;

  /**
   * @desc 菜单项横向外间距
   * @descEN Horizontal margin of menu item
   */
  itemMarginInline: number;
  /**
   * @desc 横向菜单项横悬浮态背景色
   * @descEN Background color of horizontal menu item when hover
   */
  horizontalItemHoverBg: string;
  /**
   * @desc 横向菜单项圆角
   * @descEN Border radius of horizontal menu item
   */
  horizontalItemBorderRadius: number;
  /**
   * @desc 菜单项高度
   * @descEN Height of menu item
   */
  itemHeight: number | string;
  /**
   * @desc 收起后的宽度
   * @descEN Width when collapsed
   */
  collapsedWidth: number | string;
  /**
   * @desc 弹出框背景色
   * @descEN Background color of popup
   */
  popupBg: string;
  /**
   * @desc 菜单项纵向外间距
   * @descEN margin-block of menu item
   */
  itemMarginBlock: CSSProperties['marginBlock'];
  /**
   * @desc 菜单项横向内间距
   * @descEN padding-inline of menu item
   */
  itemPaddingInline: CSSProperties['paddingInline'];
  /**
   * @desc 横向菜单行高
   * @descEN LineHeight of horizontal menu item
   */
  horizontalLineHeight: CSSProperties['lineHeight'];
  /**
   * @desc 图标与文字间距
   * @descEN Spacing between icon and text
   */
  iconMarginInlineEnd: CSSProperties['marginInlineEnd'];
  /**
   * @desc 图标尺寸
   * @descEN Size of icon
   */
  iconSize: number;
  /**
   * @desc 收起时图标尺寸
   * @descEN Size of icon when collapsed
   */
  collapsedIconSize: number;

  // Dark
  /**
   * @desc 暗色模式下的浮层菜单的背景颜色
   * @descEN The background color of the overlay menu in dark mode.
   */
  darkPopupBg: string;
  /**
   * @desc 暗色模式下的菜单项文字颜色
   * @descEN Color of menu item text in dark mode
   */
  darkItemColor: string;
  /**
   * @desc 暗色模式下的危险菜单项文字颜色
   * @descEN Color of danger menu item text in dark mode
   */
  darkDangerItemColor: string;
  /**
   * @desc 暗色模式下的菜单项背景
   * @descEN Background of menu item in dark mode
   */
  darkItemBg: string;
  /**
   * @desc 暗色模式下的子菜单项背景
   * @descEN Background of submenu item in dark mode
   */
  darkSubMenuItemBg: string;
  /**
   * @desc 暗色模式下的菜单项选中颜色
   * @descEN Color of selected menu item in dark mode
   */
  darkItemSelectedColor: string;
  /**
   * @desc 暗色模式下的菜单项选中背景
   * @descEN Background of active menu item in dark mode
   */
  darkItemSelectedBg: string;
  /**
   * @desc 暗色模式下的菜单项悬浮背景
   * @descEN Background of hovered menu item in dark mode
   */
  darkItemHoverBg: string;
  /**
   * @desc 暗色模式下的分组标题文字颜色
   * @descEN Color of group title text in dark mode
   */
  darkGroupTitleColor: string;
  /**
   * @desc 暗色模式下的菜单项悬浮颜色
   * @descEN Color of hovered menu item in dark mode
   */
  darkItemHoverColor: string;
  /**
   * @desc 暗色模式下的菜单项禁用颜色
   * @descEN Color of disabled menu item in dark mode
   */
  darkItemDisabledColor: string;
  /**
   * @desc 暗色模式下的危险菜单项选中背景
   * @descEN Background of active danger menu item in dark mode
   */
  darkDangerItemSelectedBg: string;
  /**
   * @desc 暗色模式下的危险菜单项悬浮文字背景
   * @descEN Background of hovered danger menu item in dark mode
   */
  darkDangerItemHoverColor: string;
  /**
   * @desc 暗色模式下的危险菜单项选中文字颜色
   * @descEN Color of selected danger menu item in dark mode
   */
  darkDangerItemSelectedColor: string;
  /**
   * @desc 暗色模式下的危险菜单项激活态背景
   * @descEN Background of active danger menu item in dark mode
   */
  darkDangerItemActiveBg: string;
  /** @internal */
  itemWidth: number | string;
}

/**
 * @desc Menu 组件的 Token
 * @descEN Token for Menu component
 */
export interface MenuToken extends FullToken<'Menu'> {
  /**
   * @desc 水平菜单高度
   * @descEN Height of horizontal menu
   */
  menuHorizontalHeight: number | string;
  /**
   * @desc 菜单箭头尺寸
   * @descEN Size of menu arrow
   */
  menuArrowSize: number | string;
  /**
   * @desc 菜单箭头偏移量
   * @descEN Offset of menu arrow
   */
  menuArrowOffset: number | string;
  /**
   * @desc 子菜单背景色
   * @descEN Background color of sub-menu
   */
  menuSubMenuBg: string;
  /**
   * @desc 暗色模式下的浮层菜单背景色
   * @descEN Background color of popup menu in dark mode
   */
  darkPopupBg: string;
}

原生通用属性

Tips: 以下通用属性适用于 antd 大部分组件,不支持的组件会单独说明。

参数说明类型默认值
style自定义样式CSSProperties-
className自定义类名string-
rootClassName添加在组件最外层的 classNamestring-
autoFocus自动获取焦点,仅对表单类、链接、交互容器等可聚焦元素生效booleanfalse

安装并复现示例

npm install antd@6.6.5 @ant-design/icons@6.3.4 dayjs@1.11.23

使用 ConfigProvider 和原生 App,并单独配置 dayjs 语言。每个示例在查看代码中列出完整源码文件和额外固定依赖。示例名称用于选择演示,不是组件通用属性。主题、语言与 SSR 初始化见资源安装指南。

原生类型参考

源码查看器包含未修改的原生实现和以下声明文件,继承类型仍位于原生包中。代码中的英文注释保留为源码参考。

  • vendor/components/menu/MenuContext.tsx
  • vendor/components/menu/MenuDivider.tsx
  • vendor/components/menu/MenuItem.tsx
  • vendor/components/menu/OverrideContext.tsx
  • vendor/components/menu/SubMenu.tsx
  • vendor/components/menu/index.tsx
  • vendor/components/menu/interface.ts
  • vendor/components/menu/menu.tsx
  • vendor/components/menu/style/index.ts

来源与许可

https://github.com/ant-design/ant-design/tree/4a39f54842eade4e565ab336ef6097cd7e723cdd

保留原生中英文正文与可执行示例;官网专用的嵌入章节和令牌表格在本地展开。Ant Design 使用 MIT 许可,另列依赖的许可证也需保留。上传预览禁止向外发起请求,不提供后端服务。