让头部区域、侧边栏以及左侧菜单的宽、高更容易调整

(make it easy to adjust the height or width of header, sidebar and sidemenu)
pull/322/head
dfish 2021-12-13 02:50:26 +08:00
parent 274198a7bd
commit e4cc927457
3 changed files with 19 additions and 9 deletions

View File

@ -2,6 +2,16 @@
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
:root{
--header-height:55px;
--sidebar-width:200px;
--sidemenu-height:45px;
}
.el-menu-item, .el-submenu__title{
height: var(--sidemenu-height) !important;
line-height: var(--sidemenu-height) !important;
}
html, html,
body, body,
@ -23,9 +33,9 @@ a {
.content-box { .content-box {
position: absolute; position: absolute;
left: 250px; left: var(--sidebar-width);
right: 0; right: 0;
top: 70px; top: var(--header-height);
bottom: 0; bottom: 0;
padding-bottom: 30px; padding-bottom: 30px;
-webkit-transition: left .3s ease-in-out; -webkit-transition: left .3s ease-in-out;

View File

@ -58,7 +58,7 @@ export default {
}; };
onMounted(() => { onMounted(() => {
if (document.body.clientWidth < 1500) { if (document.body.clientWidth < 1000) {
collapseChage(); collapseChage();
} }
}); });
@ -89,7 +89,7 @@ export default {
position: relative; position: relative;
box-sizing: border-box; box-sizing: border-box;
width: 100%; width: 100%;
height: 70px; height: var(--header-height);
font-size: 22px; font-size: 22px;
color: #fff; color: #fff;
} }
@ -97,12 +97,12 @@ export default {
float: left; float: left;
padding: 0 21px; padding: 0 21px;
cursor: pointer; cursor: pointer;
line-height: 70px; line-height: var(--header-height);
} }
.header .logo { .header .logo {
float: left; float: left;
width: 250px; width: 250px;
line-height: 70px; line-height: var(--header-height);
} }
.header-right { .header-right {
float: right; float: right;
@ -110,7 +110,7 @@ export default {
} }
.header-user-con { .header-user-con {
display: flex; display: flex;
height: 70px; height: var(--header-height);
align-items: center; align-items: center;
} }
.btn-fullscreen { .btn-fullscreen {

View File

@ -138,7 +138,7 @@ export default {
display: block; display: block;
position: absolute; position: absolute;
left: 0; left: 0;
top: 70px; top: var(--header-height);
bottom: 0; bottom: 0;
overflow-y: scroll; overflow-y: scroll;
} }
@ -146,7 +146,7 @@ export default {
width: 0; width: 0;
} }
.sidebar-el-menu:not(.el-menu--collapse) { .sidebar-el-menu:not(.el-menu--collapse) {
width: 250px; width: var(--sidebar-width);
} }
.sidebar > ul { .sidebar > ul {
height: 100%; height: 100%;