跳转到内容

ProDrawer 抽屉

ProDrawer 是基于Antv Drawer的扩展,支持Antv Drawer的所有属性。

使用演示

通过 description 设置抽屉描述,通过 showFullscreen 设置抽屉全屏按钮显示,通过 defaultFullscreen 设置抽屉默认全屏显示,其他使用示例请前往Antv Drawer查看。

API

Props

参数说明类型默认值
description抽屉描述string-
show-fullscreen显示全屏按钮booleantrue
default-fullscreen默认全屏显示booleanfalse
autofocus抽屉展开后是否将焦点切换至其 Dom 节点booleantrue
body-style可用于设置 Drawer 内容部分的样式CSSProperties-
classDrawer 容器外层 className 设置,如果需要设置最外层,请使用 rootClassNamestring-
closable是否显示左上角的关闭按钮booleantrue
content-wrapper-style可用于设置 Drawer 包裹内容部分的样式CSSProperties-
destroy-on-close关闭时销毁 Drawer 里的子元素booleanfalse
footer-style抽屉页脚部件的样式CSSProperties-
force-render预渲染 Drawer 内元素booleanfalse
get-container指定 Drawer 挂载的节点,并在容器内展现() => HTMLElement | Selectors'body'
header-style用于设置 Drawer 头部的样式CSSProperties-
height高度, 在 placementtopbottom 时使用string | number378
keyboard是否支持键盘 esc 关闭booleantrue
mask是否展示遮罩booleantrue
mask-closable点击蒙层是否允许关闭booleantrue
mask-style遮罩样式CSSProperties-
placement抽屉的方向'top' | 'right' | 'bottom' | 'left''right'
push用于设置多层 Drawer 的推动行为boolean | {distance: string | number}{ distance: 180 }
root-class-name对话框外层容器的类名string-
root-style可用于设置 Drawer 最外层容器的样式,和 style 的区别是作用节点包括 maskCSSProperties-
size预设抽屉宽度(或高度),default 378px 和 large 736pxdefault | largedefault
style设计 Drawer 容器样式,如果你只需要设置内容部分请使用 bodyStyleCSSProperties-
title标题string-
open(v-model)Drawer 是否可见boolean-
width宽度string | number378
z-index设置 Drawer 的 z-indexnumber1000

Events

事件名说明类型
close点击遮罩层或左上角叉或取消按钮的回调(e: MouseEvent)=>void
after-open-change切换抽屉时动画结束后的回调(open: boolean)=>void
full-screen点击左上角全屏按钮的回调(fullscreen: boolean)=>void

Slots

插槽名说明类型
default抽屉的内容-
title抽屉的标题-
description抽屉的描述-
extra抽屉右上角的操作区域-
footer抽屉的页脚-

源代码

组件样式文档

贡献者