chore(types): button

pull/2692/head^2
Amour1688 2020-08-17 18:41:55 +08:00
parent 50ae500253
commit 1d8341bbee
1 changed files with 10 additions and 9 deletions

View File

@ -3,6 +3,7 @@
// Definitions: https://github.com/vueComponent/ant-design-vue/types // Definitions: https://github.com/vueComponent/ant-design-vue/types
import { ButtonGroup } from './button-group'; import { ButtonGroup } from './button-group';
import { VNodeChild } from 'vue';
export declare class Button { export declare class Button {
static Group: typeof ButtonGroup; static Group: typeof ButtonGroup;
@ -13,61 +14,61 @@ export declare class Button {
* @default 'default' * @default 'default'
* @type string * @type string
*/ */
type: 'primary' | 'danger' | 'dashed' | 'ghost' | 'default'; type?: 'primary' | 'danger' | 'dashed' | 'ghost' | 'default';
/** /**
* set the original html type of button * set the original html type of button
* @default 'button' * @default 'button'
* @type string * @type string
*/ */
htmlType: 'button' | 'submit' | 'reset' | 'menu'; htmlType?: 'button' | 'submit' | 'reset' | 'menu';
/** /**
* set the icon of button * set the icon of button
* @type string * @type string
*/ */
icon: string; icon?: VNodeChild | JSX.Element;
/** /**
* can be set to circle or circle-outline or omitted * can be set to circle or circle-outline or omitted
* @type string * @type string
*/ */
shape: 'circle' | 'circle-outline'; shape?: 'circle' | 'circle-outline';
/** /**
* can be set to small large or omitted * can be set to small large or omitted
* @default 'default' * @default 'default'
* @type string * @type string
*/ */
size: 'small' | 'large' | 'default'; size?: 'small' | 'large' | 'default';
/** /**
* set the loading status of button * set the loading status of button
* @default false * @default false
* @type boolean | { delay: number } * @type boolean | { delay: number }
*/ */
loading: boolean | { delay: number }; loading?: boolean | { delay: number };
/** /**
* disabled state of button * disabled state of button
* @default false * @default false
* @type boolean * @type boolean
*/ */
disabled: boolean; disabled?: boolean;
/** /**
* make background transparent and invert text and border colors, added in 2.7 * make background transparent and invert text and border colors, added in 2.7
* @default false * @default false
* @type boolean * @type boolean
*/ */
ghost: boolean; ghost?: boolean;
/** /**
* option to fit button width to its parent width * option to fit button width to its parent width
* @default false * @default false
* @type boolean * @type boolean
*/ */
block: boolean; block?: boolean;
onClick?: (e?: Event) => void; onClick?: (e?: Event) => void;
}; };