tdesign-vue
Version:
36 lines (35 loc) • 1.27 kB
TypeScript
import { PopupProps } from '../popup';
import { TNode } from '../common';
export interface TdDropdownProps {
direction?: 'left' | 'right';
disabled?: boolean;
hideAfterItemClick?: boolean;
maxColumnWidth?: string | number;
maxHeight?: number;
minColumnWidth?: string | number;
options?: Array<DropdownOption>;
placement?: 'top' | 'left' | 'right' | 'bottom' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'left-top' | 'left-bottom' | 'right-top' | 'right-bottom';
popupProps?: PopupProps;
trigger?: 'hover' | 'click' | 'focus' | 'context-menu';
onClick?: (dropdownItem: DropdownOption, context: {
e: MouseEvent;
}) => void;
}
export interface TdDropdownItemProps {
active?: boolean;
content?: string | TNode;
disabled?: boolean;
divider?: boolean;
prefixIcon?: TNode;
theme?: DropdownItemTheme;
value?: string | number | {
[key: string]: any;
};
onClick?: (dropdownItem: DropdownOption, context: {
e: MouseEvent;
}) => void;
}
export declare type DropdownOption = {
children?: Array<TdDropdownItemProps>;
} & TdDropdownItemProps & Record<string, any>;
export declare type DropdownItemTheme = 'default' | 'success' | 'warning' | 'error';