浏览代码

框架滚动方式修改

yuhan 1 年之前
父节点
当前提交
2faaae24a3
共有 2 个文件被更改,包括 15 次插入3 次删除
  1. 2 0
      src/App.vue
  2. 13 3
      src/components/page/GlobalLayout.vue

+ 2 - 0
src/App.vue

@@ -40,5 +40,7 @@
 <style>
   #app {
     height: 100%;
+    /* 改变框架 */
+    overflow: hidden;
   }
 </style>

+ 13 - 3
src/components/page/GlobalLayout.vue

@@ -54,9 +54,10 @@
       </a-drawer>
     </template>
 
+    <!-- 改变框架 -->
     <a-layout
       :class="[layoutMode, `content-width-${contentWidth}`]"
-      :style="{ paddingLeft: fixSiderbar && isDesktop() ? `${sidebarOpened ? 200 : 80}px` : '0' }">
+      :style="{ paddingLeft: fixSiderbar && isDesktop() ? `${sidebarOpened ? 200 : 80}px` : '0', height: '100vh', overflow: 'auto', display: 'block', }">
       <!-- layout header -->
       <global-header
         :mode="layoutMode"
@@ -69,7 +70,9 @@
       />
 
       <!-- layout content -->
-      <a-layout-content :style="{ height: '100%', paddingTop: fixedHeader ? '59px' : '0' }">
+      <!-- 改变框架 -->
+      <a-layout-content :style="{ minHeight: '90%', paddingTop: fixedHeader ? '59px' : '0' }">
+      <!-- <a-layout-content :style="{ height: '100%', paddingTop: fixedHeader ? '59px' : '0' }"> -->
         <slot></slot>
       </a-layout-content>
 
@@ -206,7 +209,7 @@
     &.mobile {
 
       .ant-layout-content {
-
+        
         .content {
           margin: 24px 0 0;
         }
@@ -227,6 +230,9 @@
         }
       }
       .sidemenu {
+        /* 改变框架 */
+        height: 100%;
+        overflow: auto;
         .ant-header-fixedHeader {
 
           &.ant-header-side-opened, &.ant-header-side-closed {
@@ -298,6 +304,10 @@
     }
 
     .sidemenu {
+      /* 改变框架 */
+      // height: calc(100vh - 59px);
+      // height: 100vh;
+      overflow: auto;
       .ant-header-fixedHeader {
         position: fixed;
         top: 0;