Skip to content

Commit 576f89b

Browse files
committed
界面高度自适应屏幕高度
1 parent be3259a commit 576f89b

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

src/components/layout.vue

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div class="layout">
3-
<el-container>
3+
<el-container style="min-height: 100vh">
44
<el-header>
55
<div width="200px" class="logo"></div>
66
</el-header>
@@ -72,18 +72,6 @@
7272
this.defaultActive = this.$route.path.split('/')[1] ? this.$route.path.split('/')[1] : 'item1';
7373
},
7474
mounted() {
75-
const layoutMain = $('.el-main');
76-
const aside = $('.el-aside');
77-
let heightMain = `${$(window).height() - 120}px`;
78-
let heightSide = `${$(window).height() - 60}px`;
79-
layoutMain.css('height', heightMain);
80-
aside.css('height', heightSide);
81-
$(window).resize(() => {
82-
heightMain = `${$(window).height() - 127}px`;
83-
heightSide = `${$(window).height() - 60}px`;
84-
layoutMain.css('height', heightMain);
85-
aside.css('height', heightSide);
86-
});
8775
this.doQuery();
8876
},
8977

0 commit comments

Comments
 (0)