Commit 18cf34f7 authored by 好多大米's avatar 好多大米 Committed by GitHub

fix(Drawer): fix size number bug (#20718)

parent b4efaa3d
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
:aria-label="title" :aria-label="title"
class="el-drawer" class="el-drawer"
:class="[direction, customClass]" :class="[direction, customClass]"
:style="isHorizontal ? `width: ${size}` : `height: ${size}`" :style="isHorizontal ? `width: ${drawerSize}` : `height: ${drawerSize}`"
ref="drawer" ref="drawer"
role="dialog" role="dialog"
tabindex="-1" tabindex="-1"
...@@ -93,7 +93,7 @@ export default { ...@@ -93,7 +93,7 @@ export default {
default: true default: true
}, },
size: { size: {
type: String, type: [Number, String],
default: '30%' default: '30%'
}, },
title: { title: {
...@@ -115,6 +115,9 @@ export default { ...@@ -115,6 +115,9 @@ export default {
computed: { computed: {
isHorizontal() { isHorizontal() {
return this.direction === 'rtl' || this.direction === 'ltr'; return this.direction === 'rtl' || this.direction === 'ltr';
},
drawerSize() {
return typeof this.size === 'number' ? `${this.size}px` : this.size;
} }
}, },
data() { data() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment