Skip to content

Commit

Permalink
fix(Drawer): fix size number bug (ElemeFE#20718)
Browse files Browse the repository at this point in the history
  • Loading branch information
cs1707 authored and hzsrc committed Feb 2, 2023
1 parent 67c3af0 commit 0143f3f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/drawer/src/main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -93,7 +93,7 @@ export default {
default: true
},
size: {
type: String,
type: [Number, String],
default: '30%'
},
title: {
Expand All @@ -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() {
Expand Down

0 comments on commit 0143f3f

Please sign in to comment.