Sfoglia il codice sorgente

Fixed siderbar should be scrollable, close #2191

afc163 7 anni fa
parent
commit
3700c13c4a
1 ha cambiato i file con 8 aggiunte e 2 eliminazioni
  1. 8 2
      src/components/SiderMenu/index.less

+ 8 - 2
src/components/SiderMenu/index.less

@@ -1,9 +1,11 @@
 @import '~antd/lib/style/themes/default.less';
 @import '~antd/lib/style/themes/default.less';
 
 
+@nav-header-height: 64px;
+
 .logo {
 .logo {
-  height: 64px;
+  height: @nav-header-height;
   position: relative;
   position: relative;
-  line-height: 64px;
+  line-height: @nav-header-height;
   padding-left: (@menu-collapsed-width - 32px) / 2;
   padding-left: (@menu-collapsed-width - 32px) / 2;
   transition: all 0.3s;
   transition: all 0.3s;
   background: #002140;
   background: #002140;
@@ -33,6 +35,10 @@
     position: fixed;
     position: fixed;
     top: 0;
     top: 0;
     left: 0;
     left: 0;
+    :global(.ant-menu-root) {
+      overflow-y: auto;
+      height: ~'calc(100vh - @{nav-header-height})';
+    }
   }
   }
   &.light {
   &.light {
     box-shadow: 2px 0 8px 0 rgba(29, 35, 41, 0.05);
     box-shadow: 2px 0 8px 0 rgba(29, 35, 41, 0.05);