Quellcode durchsuchen

style(header): use sticky replace fixed

0xJacky vor 2 Jahren
Ursprung
Commit
9eab625ee5
2 geänderte Dateien mit 3 neuen und 8 gelöschten Zeilen
  1. 1 5
      frontend/src/layouts/BaseLayout.vue
  2. 2 3
      frontend/src/layouts/HeaderLayout.vue

+ 1 - 5
frontend/src/layouts/BaseLayout.vue

@@ -64,7 +64,7 @@ const lang = computed(() => {
             </a-layout-sider>
 
             <a-layout>
-                <a-layout-header :style="{position: 'fixed', zIndex: 10, width:'100%'}">
+                <a-layout-header :style="{position: 'sticky', top: '0', zIndex: 10, width:'100%'}">
                     <header-layout @clickUnFold="drawer_visible=true"/>
                 </a-layout-header>
 
@@ -104,9 +104,6 @@ const lang = computed(() => {
 
 <style lang="less">
 .layout-sider .sidebar {
-    //position: fixed;
-    //width: 200px;
-
     ul.ant-menu-inline.ant-menu-root {
         height: calc(100vh - 120px);
         overflow-y: auto;
@@ -237,7 +234,6 @@ body {
 }
 
 .ant-layout-content {
-    margin: 64px 0;
     min-height: auto;
 
     .router-view {

+ 2 - 3
frontend/src/layouts/HeaderLayout.vue

@@ -49,7 +49,6 @@ function logout() {
     padding: 0 20px 0 0;
     background: transparent;
     box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.05);
-    position: fixed;
     width: 100%;
 
     a {
@@ -68,7 +67,7 @@ function logout() {
 }
 
 .tool {
-    position: fixed;
+    position: absolute;
     left: 20px;
     @media (min-width: 600px) {
         display: none;
@@ -76,7 +75,7 @@ function logout() {
 }
 
 .user-wrapper {
-    position: fixed;
+    position: absolute;
     right: 28px;
 }