refactor(dropdown): add dropdownButtonType export and refactor defaultProps (#31957)

This commit is contained in:
Zuobin Wang 2021-09-13 19:38:09 +08:00 committed by GitHub
parent 8cd4c24afc
commit 41fbcf10c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 10 deletions

View File

@ -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;

View File

@ -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;