diff --git a/packages/devui-vue/devui/drawer/src/components/drawer-body.tsx b/packages/devui-vue/devui/drawer/src/components/drawer-body.tsx index d3525a420f..6fba8f93e9 100644 --- a/packages/devui-vue/devui/drawer/src/components/drawer-body.tsx +++ b/packages/devui-vue/devui/drawer/src/components/drawer-body.tsx @@ -1,4 +1,4 @@ -import { defineComponent, inject, computed } from 'vue' +import { defineComponent, inject, computed, Transition } from 'vue' import './drawer-body.scss' @@ -14,6 +14,7 @@ export default defineComponent({ const visible: boolean = inject('visible') const backdropCloseable: any = inject('backdropCloseable') const destroyOnHide: any = inject('destroyOnHide') + const showAnimation: any = inject('showAnimation') const navRight = computed(() => position.value === 'right' ? { 'right': 0 } : { 'left': 0 }) const navWidth = computed(() => isFullScreen.value ? '100vw' : width.value) @@ -34,6 +35,8 @@ export default defineComponent({ navRight, navWidth, visible, + position, + showAnimation, clickContent, handleDrawerClose, destroyOnHide, @@ -42,25 +45,27 @@ export default defineComponent({ render() { const { - zindex, slots, isCover, navRight, navWidth, - visible, handleDrawerClose, destroyOnHide } = this + zindex, slots, isCover, navRight, navWidth, showAnimation, + visible, handleDrawerClose, destroyOnHide, position } = this if (destroyOnHide.value && !visible) { return null } - const visibleVal = visible ? 'visible' : 'hidden' + const transitionName = showAnimation ? position : 'none' return ( -