mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-07 09:26:06 +08:00
refactor(dropdown): add dropdownButtonType export and refactor defaultProps (#31957)
This commit is contained in:
parent
8cd4c24afc
commit
41fbcf10c1
@ -9,7 +9,7 @@ import Dropdown, { DropDownProps } from './dropdown';
|
||||
|
||||
const ButtonGroup = Button.Group;
|
||||
|
||||
type DropdownButtonType = 'primary' | 'ghost' | 'dashed';
|
||||
export type DropdownButtonType = 'default' | 'primary' | 'ghost' | 'dashed' | 'link' | 'text';
|
||||
|
||||
export interface DropdownButtonProps extends ButtonGroupProps, DropDownProps {
|
||||
type?: DropdownButtonType;
|
||||
@ -36,7 +36,7 @@ const DropdownButton: DropdownButtonInterface = props => {
|
||||
|
||||
const {
|
||||
prefixCls: customizePrefixCls,
|
||||
type,
|
||||
type = 'default',
|
||||
disabled,
|
||||
onClick,
|
||||
htmlType,
|
||||
@ -52,7 +52,7 @@ const DropdownButton: DropdownButtonInterface = props => {
|
||||
href,
|
||||
icon = <EllipsisOutlined />,
|
||||
title,
|
||||
buttonsRender,
|
||||
buttonsRender = (buttons: React.ReactNode[]) => buttons,
|
||||
mouseEnterDelay,
|
||||
mouseLeaveDelay,
|
||||
overlayClassName,
|
||||
@ -111,9 +111,4 @@ const DropdownButton: DropdownButtonInterface = props => {
|
||||
|
||||
DropdownButton.__ANT_BUTTON = true;
|
||||
|
||||
DropdownButton.defaultProps = {
|
||||
type: 'default' as DropdownButtonType,
|
||||
buttonsRender: (buttons: React.ReactNode[]) => buttons,
|
||||
};
|
||||
|
||||
export default DropdownButton;
|
||||
|
@ -1,6 +1,5 @@
|
||||
import Dropdown from './dropdown';
|
||||
|
||||
export { DropDownProps } from './dropdown';
|
||||
export { DropdownButtonProps } from './dropdown-button';
|
||||
|
||||
export { DropdownButtonProps, DropdownButtonType } from './dropdown-button';
|
||||
export default Dropdown;
|
||||
|
Loading…
Reference in New Issue
Block a user