diff --git a/components/dropdown/dropdown-button.tsx b/components/dropdown/dropdown-button.tsx index 9f329522e7..896ee2b540 100644 --- a/components/dropdown/dropdown-button.tsx +++ b/components/dropdown/dropdown-button.tsx @@ -16,6 +16,7 @@ export interface DropdownButtonProps { onVisibleChange?: (visible: boolean) => void; style?: React.CSSProperties; prefixCls?: string; + children: any; } export default class DropdownButton extends React.Component { @@ -41,10 +42,10 @@ export default class DropdownButton extends React.Component; @@ -9,6 +10,7 @@ export interface DropDownProps { visible?: boolean; align?: Object; getPopupContainer?: () => HTMLElement; + prefixCls?: string; } export default class Dropdown extends React.Component { @@ -21,6 +23,14 @@ export default class Dropdown extends React.Component { }; render() { - return ; + const { children, prefixCls } = this.props; + const dropdownTrigger = cloneElement(children as any, { + className: classNames((children as any).props.className, `${prefixCls}-trigger`), + }); + return ( + + {dropdownTrigger} + + ); } } diff --git a/components/dropdown/style/index.less b/components/dropdown/style/index.less index 007f2e4c19..50d6f3ebca 100644 --- a/components/dropdown/style/index.less +++ b/components/dropdown/style/index.less @@ -17,7 +17,7 @@ position: relative; .@{ant-prefix}-btn > .@{iconfont-css-prefix}-down { - .iconfont-size-under-12px(9px); + .iconfont-size-under-12px(10px); } .@{iconfont-css-prefix}-down:before { @@ -109,7 +109,7 @@ content: "\e61f"; right: 16px; color: @text-color-secondary; - .iconfont-size-under-12px(9px); + .iconfont-size-under-12px(10px); } &-submenu-vertical { @@ -153,10 +153,11 @@ } } +.@{dropdown-prefix-cls}-trigger, .@{dropdown-prefix-cls}-link { font-size: @font-size-base; .@{iconfont-css-prefix}-down { - .iconfont-size-under-12px(9px); + .iconfont-size-under-12px(10px); } } @@ -165,10 +166,6 @@ padding-right: 7px; } .@{iconfont-css-prefix}-down { - .iconfont-size-under-12px(9px); + .iconfont-size-under-12px(10px); } } - -.ant-btn .anticon-down { - .iconfont-size-under-12px(9px); -}