From b22dfe297b0a7a942ca2da10ec19c99638dca856 Mon Sep 17 00:00:00 2001 From: wangxueliang Date: Wed, 10 Apr 2019 09:41:02 +0800 Subject: [PATCH] feat: update menu --- components/menu/index.jsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/components/menu/index.jsx b/components/menu/index.jsx index 9ff48f5d2..89eff424b 100644 --- a/components/menu/index.jsx +++ b/components/menu/index.jsx @@ -7,6 +7,7 @@ import Item from './MenuItem'; import { hasProp } from '../_util/props-util'; import BaseMixin from '../_util/BaseMixin'; import commonPropsType from '../vc-menu/commonPropsType'; +import { ConfigConsumerProps } from '../config-provider'; export const MenuMode = PropTypes.oneOf([ 'vertical', @@ -27,7 +28,7 @@ export const menuProps = { defaultOpenKeys: PropTypes.array, openAnimation: PropTypes.oneOfType([PropTypes.string, PropTypes.object]), openTransitionName: PropTypes.string, - prefixCls: PropTypes.string.def('ant-menu'), + prefixCls: PropTypes.string, multiple: PropTypes.bool, inlineIndent: PropTypes.number.def(24), inlineCollapsed: PropTypes.bool, @@ -206,7 +207,9 @@ const Menu = { const { layoutSiderContext, $slots, $listeners } = this; const { collapsedWidth } = layoutSiderContext; const { getPopupContainer: getContextPopupContainer } = this.configProvider; - const { prefixCls, theme, getPopupContainer } = this.$props; + const { prefixCls: customizePrefixCls, theme, getPopupContainer } = this.$props; + const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls; + const prefixCls = getPrefixCls('menu', customizePrefixCls); const menuMode = this.getRealMenuMode(); const menuOpenAnimation = this.getMenuOpenAnimation(menuMode); @@ -221,6 +224,7 @@ const Menu = { getPopupContainer: getPopupContainer || getContextPopupContainer, openKeys: this.sOpenKeys, mode: menuMode, + prefixCls, }, on: { ...$listeners,