# @beisen-phoenix/drawer

> --- type: 反馈 category: Components subtitle: 抽屉 title: Drawer ---

Latest version **3.3.55** (published 2019-11-25) · ISC license · 0 weekly downloads

## Install

```sh
npm install @beisen-phoenix/drawer
pnpm add @beisen-phoenix/drawer
yarn add @beisen-phoenix/drawer
bun add @beisen-phoenix/drawer
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.3.55 |
| Published | 2019-11-25 |
| First published | 2019-08-27 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 51.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | beisencorp |

## Links

- npm: https://www.npmjs.com/package/@beisen-phoenix/drawer
- npm.io page: https://npm.io/package/@beisen-phoenix/drawer

## Dependencies (4)

- [antd](https://npm.io/package/antd.md) ^3.22.1
- [lodash.debounce](https://npm.io/package/lodash.debounce.md) ^4.0.8
- [lodash.uniqueid](https://npm.io/package/lodash.uniqueid.md) ^4.0.1
- [@beisen-phoenix/style-token](https://npm.io/package/@beisen-phoenix/style-token.md) ^3.3.55

## Recent versions

- 3.3.55 (latest) — 2019-11-25
- 3.2.44-rc.1 (rc) — 2019-10-24
- 3.3.54 — 2019-11-25
- 3.3.53 — 2019-11-25
- 3.3.52 — 2019-11-24
- 3.3.51 — 2019-11-23
- 3.3.50 — 2019-11-22
- 3.3.49 — 2019-11-22
- 3.3.48 — 2019-11-22
- 3.3.47 — 2019-11-22
- 3.3.46 — 2019-11-22
- 3.3.45 — 2019-11-21
- 3.3.43 — 2019-11-21
- 3.3.42 — 2019-11-21
- 3.3.41-beta.1 — 2019-11-21
- … 128 more at https://npm.io/package/@beisen-phoenix/drawer/versions

## README

---
type: 反馈
category: Components
subtitle: 抽屉
title: Drawer
---

屏幕边缘滑出的浮层面板。

## 何时使用

抽屉从父窗体边缘滑入，覆盖住部分父窗体内容。用户在抽屉内操作时不必离开当前任务，操作完成后，可以平滑地回到到原任务。

- 当需要一个附加的面板来控制父窗体内容，这个面板在需要时呼出。比如，控制界面展示样式，往界面中添加内容。
- 当需要在当前任务流中插入临时任务，创建或预览附加内容。比如展示协议条款，创建子对象。

## API

| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| closable | 是否显示右上角的关闭按钮 | boolean | true | |
| destroyOnClose | 关闭时销毁 Drawer 里的子元素 | boolean | false |  |
| getContainer | 指定 Drawer 挂载的 HTML 节点, false 为挂载在当前 dom | HTMLElement \| `() => HTMLElement` \| Selectors \| false | 'body' |  |
| maskClosable | 点击蒙层是否允许关闭 | boolean | true |  |
| mask | 是否展示遮罩 | Boolean | true |  |
| maskStyle | 遮罩样式 | object | {} |  |
| style | 可用于设置 Drawer 最外层容器的样式 | object | - |  |
| bodyStyle | 可用于设置 Drawer 的样式，调整浮层位置等 | object | - |  |
| title | 标题 | string \| ReactNode | - |  |
| visible | Drawer 是否可见 | boolean | - |  |
| width | 宽度 | string \| number | 256 |  |
| height | 高度, 在 `placement` 为 `top` 或 `bottom` 时使用 | string \| number | 256 |  |
| className | 对话框外层容器的类名 | string | - | 3.8.0 |
| zIndex | 设置 Drawer 的 `z-index` | Number | 1000 |  |
| placement | 抽屉的方向 | 'top' \| 'right' \| 'bottom' \| 'left' | 'right' |  |
| onClose | 点击遮罩层或右上角叉或取消按钮的回调 | function(e) | 无 |  |
| afterVisibleChange | 切换抽屉时动画结束后的回调 | function(visible) | 无 |  |
| keyboard | 是否支持键盘 esc 关闭 | boolean | true |  |
| size | 右推屏的大小 | string | lg |  |

<style>
#_hj_feedback_container {
  display: none;
}
</style>

---
_Source: https://npm.io/package/@beisen-phoenix/drawer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
