Skip to content

Commit e120907

Browse files
committed
fix(drawer): 修改方向为右时全屏展示样式异常的问题
1 parent fc8bd89 commit e120907

File tree

2 files changed

+10
-15
lines changed

2 files changed

+10
-15
lines changed

devui/drawer/src/drawer.scss

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
top: 0;
66
left: 0;
77
height: 100vh;
8-
width: 100vw;
98
}
109

1110
.devui-overlay-wrapper {
@@ -15,34 +14,30 @@
1514
position: absolute;
1615
top: 0;
1716
bottom: 0;
17+
width: 100vw;
1818
}
1919

2020
.devui-overlay-backdrop {
21-
position: fixed;
21+
position: absolute;
2222
top: 0;
2323
left: 0;
2424
background: $devui-shadow;
2525
width: 100vw;
2626
height: 100vh;
2727
}
2828

29-
.devui-drawer-nav,
30-
.devui-drawer-content {
29+
.devui-drawer-nav {
3130
position: absolute;
3231
top: 0;
3332
bottom: 0;
34-
left: 0;
3533
border-radius: $devui-border-radius;
36-
}
37-
38-
.devui-drawer-nav {
3934
background: $devui-base-bg;
4035
}
4136

4237
.devui-drawer-content {
43-
left: 0;
44-
right: 0;
38+
border-radius: $devui-border-radius;
4539
overflow: auto;
4640
box-shadow: $devui-shadow-length-fullscreen-overlay $devui-shadow;
4741
padding: 20px;
42+
height: 100vh;
4843
}

devui/drawer/src/drawer.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default defineComponent({
1515
const isFullScreen = ref(false);
1616

1717
const navWidth = computed(() => isFullScreen.value ? '100vw' : width.value );
18-
const wrapperRight = computed(() => position.value === 'right' ? { 'right': width.value } : {} );
18+
const navRight = computed(() => position.value === 'right' ? { 'right': 0 } : {'left' : 0} );
1919

2020
const fullScreenEvent = () => {
2121
isFullScreen.value = !isFullScreen.value;
@@ -50,7 +50,7 @@ export default defineComponent({
5050
visible,
5151
slots,
5252
isCover,
53-
wrapperRight,
53+
navRight,
5454
fullScreenEvent,
5555
closeDrawer,
5656
};
@@ -60,15 +60,15 @@ export default defineComponent({
6060
const fullScreenEvent: any = this.fullScreenEvent;
6161
const closeDrawer: any = this.closeDrawer;
6262
const isCover: boolean = this.isCover;
63-
const wrapperRight: Record<string, unknown> = this.wrapperRight;
63+
const navRight: Record<string, unknown> = this.navRight;
6464

6565
if (!this.visible) return;
6666

6767
return (
6868
<div class="devui-drawer" style={{ zIndex: zindex }} onClick={ closeDrawer }>
6969
{isCover ? <div class="devui-overlay-backdrop"/>: ''}
70-
<div class="devui-overlay-wrapper" style={ wrapperRight }>
71-
<div class="devui-drawer-nav" style={{ 'width': this.navWidth }}>
70+
<div class="devui-overlay-wrapper">
71+
<div class="devui-drawer-nav" style={{ 'width': this.navWidth, ...navRight}}>
7272
<div class="devui-drawer-content">
7373
<DrawerHeader onToggleFullScreen={fullScreenEvent} onClose={closeDrawer} />
7474
<div> { this.slots.default ? this.slots.default() : <DrawerContainer/>} </div>

0 commit comments

Comments
 (0)