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

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

parent b4efaa3d
......@@ -19,7 +19,7 @@
:aria-label="title"
class="el-drawer"
:class="[direction, customClass]"
:style="isHorizontal ? `width: ${size}` : `height: ${size}`"
:style="isHorizontal ? `width: ${drawerSize}` : `height: ${drawerSize}`"
ref="drawer"
role="dialog"
tabindex="-1"
......@@ -93,7 +93,7 @@ export default {
default: true
},
size: {
type: String,
type: [Number, String],
default: '30%'
},
title: {
......@@ -115,6 +115,9 @@ export default {
computed: {
isHorizontal() {
return this.direction === 'rtl' || this.direction === 'ltr';
},
drawerSize() {
return typeof this.size === 'number' ? `${this.size}px` : this.size;
}
},
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