Commit 1c8acfdb authored by lijin's avatar lijin

解决出现滚动条问题

parent 8e113846
...@@ -59,7 +59,7 @@ export default { ...@@ -59,7 +59,7 @@ export default {
.app-breadcrumb.el-breadcrumb { .app-breadcrumb.el-breadcrumb {
display: inline-block; display: inline-block;
font-size: 14px; font-size: 14px;
line-height: 50px; line-height: 50px; /* 保持行高与容器高度一致 */
margin-left: 10px; margin-left: 10px;
.no-redirect { .no-redirect {
color: #97a8be; color: #97a8be;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// 主体区域 Main container // 主体区域 Main container
.main-container { .main-container {
min-height: 100%; // min-height: 100%;
margin: 0 auto; margin: 0 auto;
padding: 0 36px; padding: 0 36px;
transition: margin-left .28s; transition: margin-left .28s;
......
...@@ -62,6 +62,7 @@ ...@@ -62,6 +62,7 @@
</div> </div>
</el-menu> </el-menu>
</div> </div>
<div class="content-wrapper">
<!-- 面包屑导航 --> <!-- 面包屑导航 -->
<div class="breadcrumb-container"> <div class="breadcrumb-container">
<breadcrumb /> <breadcrumb />
...@@ -71,6 +72,7 @@ ...@@ -71,6 +72,7 @@
<app-main/> <app-main/>
</div> </div>
</div> </div>
</div>
</template> </template>
<script> <script>
...@@ -134,7 +136,7 @@ export default { ...@@ -134,7 +136,7 @@ export default {
.app-wrapper { .app-wrapper {
@include clearfix; @include clearfix;
position: relative; position: relative;
height: 100%; height: 100vh; /* 使用视口高度而不是百分比 */
width: 100%; width: 100%;
&.mobile.openSidebar{ &.mobile.openSidebar{
position: fixed; position: fixed;
...@@ -151,13 +153,36 @@ export default { ...@@ -151,13 +153,36 @@ export default {
z-index: 999; z-index: 999;
} }
.horizontal-menu { .horizontal-menu {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 1000;
box-shadow: 0 2px 12px 0 rgba(0,0,0,0.1); box-shadow: 0 2px 12px 0 rgba(0,0,0,0.1);
background-color: #545c64;
height: 60px; /* 明确指定高度 */
} }
.breadcrumb-container { .breadcrumb-container {
padding: 0px 20px; padding: 0px 20px;
margin-bottom: 5px;
background-color: #fff; background-color: #fff;
box-shadow: 0 1px 4px rgba(0,21,41,.08); box-shadow: 0 1px 4px rgba(0,21,41,.08);
height: 50px; /* 明确指定面包屑容器高度 */
}
.content-wrapper {
position: absolute;
top: 60px; /* 菜单栏高度 */
left: 0;
right: 0;
bottom: 0;
overflow-y: auto;
overflow-x: hidden;
}
.main-container {
min-height: calc(100% - 55px); /* 减去面包屑高度 */
} }
.el-menu--horizontal { .el-menu--horizontal {
......
...@@ -21,9 +21,8 @@ export default { ...@@ -21,9 +21,8 @@ export default {
<style scoped> <style scoped>
.app-main { .app-main {
/*50 = navbar */
min-height: calc(100vh - 50px);
position: relative; position: relative;
overflow: hidden; height: 100%;
overflow: auto; /* 允许内容滚动 */
} }
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment