mirror of
https://github.com/element-plus/element-plus.git
synced 2024-12-21 02:50:11 +08:00
fix: Fix Drawer error size prop to support Number (#1335)
This commit is contained in:
parent
d58f480aa3
commit
6b0f716782
@ -20,7 +20,7 @@
|
|||||||
aria-labelledby="el-drawer__title"
|
aria-labelledby="el-drawer__title"
|
||||||
:aria-label="title"
|
:aria-label="title"
|
||||||
:class="['el-drawer', direction, customClass]"
|
:class="['el-drawer', direction, customClass]"
|
||||||
:style="isHorizontal ? 'width: ' + size : 'height: ' + size"
|
:style="isHorizontal ? 'width: ' + drawerSize : 'height: ' + drawerSize"
|
||||||
role="dialog"
|
role="dialog"
|
||||||
@click.stop
|
@click.stop
|
||||||
>
|
>
|
||||||
@ -104,7 +104,7 @@ export default defineComponent({
|
|||||||
default: true,
|
default: true,
|
||||||
},
|
},
|
||||||
size: {
|
size: {
|
||||||
type: String,
|
type: [String, Number],
|
||||||
default: '30%',
|
default: '30%',
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
@ -159,6 +159,7 @@ export default defineComponent({
|
|||||||
...useDialog(props, ctx as SetupContext, drawerRef),
|
...useDialog(props, ctx as SetupContext, drawerRef),
|
||||||
drawerRef,
|
drawerRef,
|
||||||
isHorizontal: computed(() => props.direction === 'rtl' || props.direction === 'ltr'),
|
isHorizontal: computed(() => props.direction === 'rtl' || props.direction === 'ltr'),
|
||||||
|
drawerSize: computed(() => typeof props.size === 'number' ? `${props.size}px` : props.size),
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user