chore: update type drawer (#2697)

pull/2705/head
jawn-ha 2020-08-18 09:37:54 +08:00 committed by GitHub
parent f099848461
commit 79bb979daa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 102 additions and 97 deletions

45
types/drawer.d.ts vendored
View File

@ -2,118 +2,123 @@
// Definitions by: akki-jat <https://github.com/akki-jat> // Definitions by: akki-jat <https://github.com/akki-jat>
// Definitions: https://github.com/vueComponent/ant-design-vue/types // Definitions: https://github.com/vueComponent/ant-design-vue/types
import { VNodeChild, CSSProperties } from 'vue';
import { AntdComponent } from './component'; import { AntdComponent } from './component';
export declare class Drawer extends AntdComponent { export declare class Drawer extends AntdComponent {
$props: {
/** /**
* Whether a close (x) button is visible on top right of the Drawer dialog or not. * Whether a close (x) button is visible on top right of the Drawer dialog or not.
* @default true * @default true
* @type boolean * @type boolean
*/ */
closable: boolean; closable?: boolean;
/** /**
* Whether to unmount child components on closing drawer or not. * Whether to unmount child components on closing drawer or not.
* @default false * @default false
* @type boolean * @type boolean
*/ */
destroyOnClose: boolean; destroyOnClose?: boolean;
/** /**
* Return the mounted node for Drawer. * Return the mounted node for Drawer.
* @default 'body' * @default 'body'
* @type any * @type any ( HTMLElement| () => HTMLElement | string)
*/ */
getContainer: any; getContainer?: () => HTMLElement | string;
/** /**
* Whether to show mask or not. * Whether to show mask or not.
* @default true * @default true
* @type boolean * @type boolean
*/ */
mask: boolean; mask?: boolean;
/** /**
* Clicking on the mask (area outside the Drawer) to close the Drawer or not. * Clicking on the mask (area outside the Drawer) to close the Drawer or not.
* @default true * @default true
* @type boolean * @type boolean
*/ */
maskClosable: boolean; maskClosable?: boolean;
/** /**
* Style for Drawer's mask element. * Style for Drawer's mask element.
* @default {} * @default {}
* @type object * @type object
*/ */
maskStyle: object; maskStyle?: CSSProperties;
/** /**
* The title for Drawer. * The title for Drawer.
* @type any (string | slot) * @type any (string | slot)
*/ */
title: any; title?: VNodeChild | JSX.Element;
/** /**
* Whether the Drawer dialog is visible or not. * Whether the Drawer dialog is visible or not.
* @default false * @default false
* @type boolean * @type boolean
*/ */
visible: boolean; visible?: boolean;
/** /**
* The class name of the container of the Drawer dialog. * The class name of the container of the Drawer dialog.
* @type string * @type string
*/ */
wrapClassName: string; wrapClassName?: string;
/** /**
* Style of wrapper element which **contains mask** compare to `drawerStyle` * Style of wrapper element which **contains mask** compare to `drawerStyle`
* @type object * @type object
*/ */
wrapStyle: object; wrapStyle?: CSSProperties;
/** /**
* Style of the popup layer element * Style of the popup layer element
* @type object * @type object
*/ */
drawerStyle: object; drawerStyle?: CSSProperties;
/** /**
* Style of floating layer, typically used for adjusting its position. * Style of floating layer, typically used for adjusting its position.
* @type object * @type object
*/ */
bodyStyle: object; bodyStyle?: CSSProperties;
headerStyle: object; headerStyle?: CSSProperties;
/** /**
* Width of the Drawer dialog. * Width of the Drawer dialog.
* @default 256 * @default 256
* @type string | number * @type string | number
*/ */
width: string | number; width?: string | number;
/** /**
* placement is top or bottom, height of the Drawer dialog. * placement is top or bottom, height of the Drawer dialog.
* @type string | number * @type string | number
*/ */
height: string | number; height?: string | number;
/** /**
* The z-index of the Drawer. * The z-index of the Drawer.
* @default 1000 * @default 1000
* @type number * @type number
*/ */
zIndex: number; zIndex?: number;
/** /**
* The placement of the Drawer. * The placement of the Drawer.
* @default 'right' * @default 'right'
* @type string * @type string
*/ */
placement: 'top' | 'right' | 'bottom' | 'left'; placement?: 'top' | 'right' | 'bottom' | 'left';
afterVisibleChange?: (visible: boolean) => void; afterVisibleChange?: (visible?: boolean) => void;
keyboard?: boolean; keyboard?: boolean;
/** /**
* Specify a callback that will be called when a user clicks mask, close button or Cancel button. * Specify a callback that will be called when a user clicks mask, close button or Cancel button.
*/ */
close(): void; onClose?: (e?: Event) => void;
};
} }