drawer.d.ts 2.1 KB

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