mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
feat(components): [drawer] add append-to (#17761)
This commit is contained in:
@@ -89,6 +89,7 @@ Drawer provides an API called `destroyOnClose`, which is a flag variable that in
|
||||
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
|
||||
| model-value / v-model | Should Drawer be displayed | ^[boolean] | false |
|
||||
| append-to-body | Controls should Drawer be inserted to DocumentBody Element, nested Drawer must assign this param to **true** | ^[boolean] | false |
|
||||
| append-to ^(2.8.0) | which element the Drawer appends to. Will override `append-to-body` | ^[string] | body |
|
||||
| lock-scroll | whether scroll of body is disabled while Drawer is displayed | ^[boolean] | true |
|
||||
| before-close | If set, closing procedure will be halted | ^[Function]`(done: (cancel?: boolean) => void) => void(done is function type that accepts a boolean as parameter, calling done with true or without parameter will abort the close procedure)` | — |
|
||||
| close-on-click-modal | whether the Drawer can be closed by clicking the mask | ^[boolean] | true |
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
<template>
|
||||
<el-teleport to="body" :disabled="!appendToBody">
|
||||
<el-teleport
|
||||
:to="appendTo"
|
||||
:disabled="appendTo !== 'body' ? false : !appendToBody"
|
||||
>
|
||||
<transition
|
||||
:name="ns.b('fade')"
|
||||
@after-enter="afterEnter"
|
||||
|
||||
Reference in New Issue
Block a user