diff --git a/packages/components/drawer/src/drawer.vue b/packages/components/drawer/src/drawer.vue index 9765d88208..782c7ce16b 100644 --- a/packages/components/drawer/src/drawer.vue +++ b/packages/components/drawer/src/drawer.vue @@ -26,6 +26,7 @@ :aria-label="title || undefined" :aria-labelledby="!title ? titleId : undefined" :aria-describedby="bodyId" + v-bind="$attrs" :class="[ns.b(), direction, visible && 'open', customClass]" :style=" isHorizontal ? 'width: ' + drawerSize : 'height: ' + drawerSize @@ -99,6 +100,7 @@ export default defineComponent({ ElIcon, Close, }, + inheritAttrs: false, props: drawerProps, emits: drawerEmits, @@ -113,6 +115,17 @@ export default defineComponent({ }, computed(() => !!slots.title) ) + useDeprecated( + { + scope: 'el-drawer', + from: 'custom-class', + replacement: 'class', + version: '2.3.0', + ref: 'https://element-plus.org/en-US/component/drawer.html#attributes', + type: 'Attribute', + }, + computed(() => !!props.customClass) + ) const drawerRef = ref() const focusStartRef = ref()