chore: update type dropdown (#2721)

This commit is contained in:
binhaoCen 2020-08-19 21:02:18 +08:00 committed by GitHub
parent 6681b50892
commit e3c38b68f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 92 additions and 85 deletions

View File

@ -4,53 +4,58 @@
import { AntdComponent } from '../component';
import { Menu } from '../menu/menu';
import { VNodeChild } from 'vue';
export declare class DropdownButton extends AntdComponent {
/**
* whether the dropdown menu is disabled
* @type boolean
*/
disabled: boolean;
$props: {
/**
* whether the dropdown menu is disabled
* @type boolean
*/
disabled?: boolean;
/**
* the dropdown menu
* @type () => Menu
*/
overlay: any;
/**
* the dropdown menu
* @type () => Menu
*/
overlay?: () => Menu
/**
* placement of pop menu: bottomLeft bottomCenter bottomRight topLeft topCenter topRight
* @default 'bottomLeft'
* @type string
*/
placement: 'topLeft' | 'topCenter' | 'topRight' | 'bottomLeft' | 'bottomCenter' | 'bottomRight';
/**
* placement of pop menu: bottomLeft bottomCenter bottomRight topLeft topCenter topRight
* @default 'bottomLeft'
* @type string
*/
placement?: 'topLeft' | 'topCenter' | 'topRight' | 'bottomLeft' | 'bottomCenter' | 'bottomRight';
/**
* size of the button, the same as Button
* @default 'default'
* @type string
*/
size: 'small' | 'large' | 'default';
/**
* size of the button, the same as Button
* @default 'default'
* @type string
*/
size?: 'small' | 'large' | 'default';
/**
* the trigger mode which executes the drop-down action
* @default ['hover']
* @type string[]
*/
trigger: Array<'click' | 'hover' | 'contextmenu'>;
/**
* the trigger mode which executes the drop-down action
* @default ['hover']
* @type string[]
*/
trigger?: Array<'click' | 'hover' | 'contextmenu'>;
/**
* type of the button, the same as Button
* @default 'default'
* @type string
*/
type: 'primary' | 'danger' | 'dashed' | 'ghost' | 'default';
/**
* type of the button, the same as Button
* @default 'default'
* @type string
*/
type?: 'primary' | 'danger' | 'dashed' | 'ghost' | 'default';
/**
* whether the dropdown menu is visible
* @type boolean
*/
visible: boolean;
icon: any;
title: string;
/**
* whether the dropdown menu is visible
* @type boolean
*/
visible?: boolean;
/**
* Icon (appears on the right) (1.5.0)
*/
icon?: VNodeChild | JSX.Element;
}
}

View File

@ -5,58 +5,60 @@
import { AntdComponent } from '../component';
import { Menu } from '../menu/menu';
import { DropdownButton } from './dropdown-button';
import { CSSProperties } from 'vue';
export declare class Dropdown extends AntdComponent {
static Button: typeof DropdownButton;
$props: {
/**
* the trigger mode which executes the drop-down action
* @default ['hover']
* @type string[]
*/
trigger?: Array<'click' | 'hover' | 'contextmenu'>;
/**
* the trigger mode which executes the drop-down action
* @default ['hover']
* @type string[]
*/
trigger: Array<'click' | 'hover' | 'contextmenu'>;
/**
* the dropdown menu
* @type () => Menu
*/
overlay?: () => Menu
/**
* the dropdown menu
* @type () => Menu
*/
overlay: any;
/**
* Class name of the dropdown root element
* @type string
*/
overlayClassName?: string;
/**
* Class name of the dropdown root element
* @type string
*/
overlayClassName: string;
/**
* Style of the dropdown root element
* @type object
*/
overlayStyle?: CSSProperties;
/**
* Style of the dropdown root element
* @type object
*/
overlayStyle: object;
/**
* whether the dropdown menu is visible
* @type boolean
*/
visible?: boolean;
/**
* whether the dropdown menu is visible
* @type boolean
*/
visible: boolean;
/**
* whether the dropdown menu is disabled
* @type boolean
*/
disabled?: boolean;
/**
* whether the dropdown menu is disabled
* @type boolean
*/
disabled: boolean;
/**
* to set the ontainer of the dropdown menu. The default is to create a div element in body, you can reset it to the scrolling area and make a relative reposition.
* @default () => document.body
* @type Function
*/
getPopupContainer?: (triggerNode?: any) => HTMLElement;
/**
* to set the ontainer of the dropdown menu. The default is to create a div element in body, you can reset it to the scrolling area and make a relative reposition.
* @default () => document.body
* @type Function
*/
getPopupContainer: (triggerNode?: any) => HTMLElement;
/**
* placement of pop menu: bottomLeft bottomCenter bottomRight topLeft topCenter topRight
* @default 'bottomLeft'
* @type string
*/
placement: 'topLeft' | 'topCenter' | 'topRight' | 'bottomLeft' | 'bottomCenter' | 'bottomRight';
/**
* placement of pop menu: bottomLeft bottomCenter bottomRight topLeft topCenter topRight
* @default 'bottomLeft'
* @type string
*/
placement?: 'topLeft' | 'topCenter' | 'topRight' | 'bottomLeft' | 'bottomCenter' | 'bottomRight';
}
}