feat(components): [drawer] add append-to (#17761)

This commit is contained in:
qiang
2024-08-05 11:32:48 +08:00
committed by GitHub
parent f5c6310d93
commit ef54dfbb35
2 changed files with 5 additions and 1 deletions

View File

@@ -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 |

View File

@@ -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"