Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refine css
  • Loading branch information
PanJiaChen committed Mar 25, 2019
commit 6e7289b7514ebdd9a51aed7528ac4287ee390d39
17 changes: 11 additions & 6 deletions src/layout/Layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,13 @@ export default {
position: relative;
height: 100%;
width: 100%;
&.mobile.openSidebar{
&.mobile.openSidebar {
position: fixed;
top: 0;
}
}
.drawer-bg {
background: #000;
opacity: 0.3;
Expand All @@ -80,18 +82,21 @@ export default {
position: absolute;
z-index: 999;
}
.fixed-header{
.fixed-header {
position: fixed;
top: 0;
right: 0;
z-index: 9;
width: calc(100% - #{$sideBarWidth});
transition: width 0.28s;
transition: width 0.28s;
}
.hideSidebar .fixed-header{
width: calc(100% - 54px)
.hideSidebar .fixed-header {
width: calc(100% - 54px)
}
.mobile .fixed-header{
.mobile .fixed-header {
width: 100%;
}
</style>
8 changes: 4 additions & 4 deletions src/layout/components/AppMain.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,25 @@ export default {

<style rel="stylesheet/scss" lang="scss" scoped>
.app-main {
/*50= navbar 50 */
/* 50= navbar 50 */
min-height: calc(100vh - 50px);
width: 100%;
position: relative;
overflow: hidden;
}
.fixed-header+.app-main {
margin-top: 50px;
padding-top: 50px;
}
.hasTagsView {
.app-main {
/*84 = navbar + tags-view = 50 + 34 */
/* 84 = navbar + tags-view = 50 + 34 */
min-height: calc(100vh - 84px);
}
.fixed-header+.app-main {
margin-top: 80px;
padding-top: 80px;
}
}
</style>
Expand Down
28 changes: 15 additions & 13 deletions src/layout/components/Sidebar/index.vue
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
<template>
<el-scrollbar wrap-class="scrollbar-wrapper">
<div :class="{'has-logo':showLogo}">
<logo v-if="showLogo" :collapse="isCollapse" />
<el-menu
:default-active="$route.path"
:collapse="isCollapse"
:background-color="variables.menuBg"
:text-color="variables.menuText"
:active-text-color="variables.menuActiveText"
:collapse-transition="false"
mode="vertical"
>
<sidebar-item v-for="route in permission_routes" :key="route.path" :item="route" :base-path="route.path" />
</el-menu>
</el-scrollbar>
<el-scrollbar wrap-class="scrollbar-wrapper">
<el-menu
:default-active="$route.path"
:collapse="isCollapse"
:background-color="variables.menuBg"
:text-color="variables.menuText"
:active-text-color="variables.menuActiveText"
:collapse-transition="false"
mode="vertical"
>
<sidebar-item v-for="route in permission_routes" :key="route.path" :item="route" :base-path="route.path" />
</el-menu>
</el-scrollbar>
</div>
</template>

<script>
Expand Down
12 changes: 12 additions & 0 deletions src/styles/sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@
right: 0px;
}

.el-scrollbar {
height: 100%;
}

&.has-logo {
.el-scrollbar {
height: calc(100% - 50px);
}
}

.is-horizontal {
display: none;
}
Expand Down Expand Up @@ -100,6 +110,7 @@

.el-tooltip {
padding: 0 !important;

.svg-icon {
margin-left: 20px;
}
Expand All @@ -111,6 +122,7 @@

&>.el-submenu__title {
padding: 0 !important;

.svg-icon {
margin-left: 20px;
}
Expand Down