UNPKG

2.16 kBTypeScriptView Raw
1import { ElementUIComponent } from './component'
2import { VNode } from 'vue'
3
4type hide = (shouldCancel: boolean) => void
5declare enum Direction {
6 LTR = 'ltr', // left to right
7 RTL = 'rtl', // right to left
8 TTB = 'ttb', // top to bottom
9 BTT = 'btt' // bottom to top
10}
11
12interface DrawerSlots {
13 /* Main Content Slots */
14 default: VNode[];
15
16 /* Title Slots */
17 title: VNode[];
18
19 [key: string]: VNode[]
20}
21/** Drawer Component */
22export declare class ElDrawer extends ElementUIComponent {
23 /* Equivalent to `Dialog`'s append to body attribute, when applying nested drawer, make sure this one is set to true */
24 appendToBody: boolean
25
26 /* Hook method called before close drawer, the first parameter is a function which should determine if the drawer should be closed */
27 beforeClose: (done: hide) => void
28
29 /** Whether the Drawer can be closed by pressing ESC */
30 closeOnPressEscape: boolean
31
32 /** Custom class names for Dialog */
33 customClass: string
34
35 /* Determine whether the wrapped children should be destroyed, if true, children's destroyed life cycle method will be called all local state will be destroyed */
36 destroyOnClose: boolean
37
38 /* Equivalent to `Dialog`'s modal attribute, determines whether the dark shadowing background should show */
39 modal: boolean
40
41 /* Equivalent to `Dialog`'s modal-append-to-body attribute, determines whether the shadowing background should be inserted direct to DocumentBody element */
42 modalAppendToBody: boolean
43
44 /* Attributes that controls the drawer's direction of display*/
45 position: Direction
46
47 /* Whether the close button should be rendered to control the drawer's visible state */
48 showClose: boolean
49
50 /* The size of the drawer component, supporting number with unit of pixel, string by percentage e.g. 30% */
51 size: number | string
52
53 /* The Drawer's title, also can be replaced by named slot `title` */
54 title: string
55
56 /* Whether the drawer component should show, also can be decorated by `.sync` */
57 visible: boolean
58
59 /* Flag attribute whi */
60 wrapperClosable: boolean
61
62 $slots: DrawerSlots
63}