22category : Components
33type : Feedback
44title : Drawer
5- cover : https://img.alicdn .com/imgextra/i4/O1CN019djdZP1OHwXSRGCOW_!!6000000001681-55-tps-161-117.svg
5+ cover : https://mdn.alipayobjects .com/huamei_7uahnr/afts/img/A*v3TvSq2E0HAAAAAAAAAAAAAADrJ8AQ/original
66---
77
88A panel which slides in from the edge of the screen.
@@ -17,16 +17,17 @@ A Drawer is a panel that is typically overlaid on top of a page and slides in fr
1717
1818## API
1919
20+ ** 🚨 Note:** v4 use ` rootClassName ` & ` rootStyle ` to config wrapper style instead of ` class ` & ` style ` in v4 to align the API with Modal.
21+
2022| Props | Description | Type | Default | Version |
2123| --- | --- | --- | --- | --- |
2224| autofocus | Whether Drawer should get focused after open | boolean | true | 3.0.0 |
2325| bodyStyle | Style of the drawer content part | CSSProperties | - | |
24- | class | The class name of the container of the Drawer dialog | string | - | |
26+ | class | Config Drawer Panel className. Use ` rootClassName ` if want to config top dom style | string | - | |
2527| closable | Whether a close (x) button is visible on top left of the Drawer dialog or not | boolean | true | |
2628| closeIcon | Custom close icon | VNode \| slot | ` <CloseOutlined /> ` | 3.0.0 |
2729| contentWrapperStyle | Style of the drawer wrapper of content part | CSSProperties | - | 3.0.0 |
2830| destroyOnClose | Whether to unmount child components on closing drawer or not | boolean | false | |
29- | drawerStyle | Style of the popup layer element | CSSProperties | - | |
3031| extra | Extra actions area at corner | VNode \| slot | - | 3.0.0 |
3132| footer | The footer for Drawer | VNode \| slot | - | 3.0.0 |
3233| footerStyle | Style of the drawer footer part | CSSProperties | - | 3.0.0 |
@@ -40,16 +41,19 @@ A Drawer is a panel that is typically overlaid on top of a page and slides in fr
4041| maskStyle | Style for Drawer's mask element | CSSProperties | {} | |
4142| placement | The placement of the Drawer | 'top' \| 'right' \| 'bottom' \| 'left' | 'right' | |
4243| push | Nested drawers push behavior | boolean \| {distance: string \| number} | { distance: 180 } | 3.0.0 |
44+ | rootClassName | The class name of the container of the Drawer dialog | string | - | 4.0 |
45+ | rootStyle | Style of wrapper element which ** contains mask** compare to ` style ` | CSSProperties | - | 4.0 |
46+ | style | Style of Drawer panel. Use ` bodyStyle ` if want to config body only | CSSProperties | - | |
4347| size | presetted size of drawer, default ` 378px ` and large ` 736px ` | ` default ` \| ` large ` | ` default ` | 3.0.0 |
4448| style | Style of wrapper element which contains mask compare to drawerStyle | CSSProperties | - | |
4549| title | The title for Drawer | string \| slot | - | |
46- | visible (v-model) | Whether the Drawer dialog is visible or not | boolean | - | |
50+ | open (v-model) | Whether the Drawer dialog is visible or not | boolean | - | 4.0 |
4751| width | Width of the Drawer dialog | string \| number | 378 | |
4852| zIndex | The ` z-index ` of the Drawer | Number | 1000 | |
4953
5054## Events
5155
5256| Name | Description | Type | Default | Version |
5357| --- | --- | --- | --- | --- |
54- | afterVisibleChange | Callback after the animation ends when switching drawers. | function(visible ) | - | |
58+ | afterOpenChange | Callback after the animation ends when switching drawers. | function(open ) | - | 4.0 |
5559| close | Specify a callback that will be called when a user clicks mask, close button or Cancel button. | function(e) | - | |
0 commit comments