mirror of https://github.com/ElemeFE/element
fix(Drawer): fix size number bug (#20718)
parent
b4efaa3d87
commit
18cf34f7b5
|
@ -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 {
|
||||||
default: true
|
default: true
|
||||||
},
|
},
|
||||||
size: {
|
size: {
|
||||||
type: String,
|
type: [Number, String],
|
||||||
default: '30%'
|
default: '30%'
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
|
@ -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() {
|
||||||
|
|
Loading…
Reference in New Issue