Skip to content

Commit 2e89ef4

Browse files
authored
perf[Navbar]: add scroll bar when the subMenu is too long (PanJiaChen#1619)
1 parent fe95080 commit 2e89ef4

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

src/styles/sidebar.scss

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,27 @@
170170
.nest-menu .el-submenu>.el-submenu__title,
171171
.el-menu-item {
172172
&:hover {
173-
// You can use $subMenuHover
173+
// you can use $subMenuHover
174174
background-color: $menuHover !important;
175175
}
176176
}
177+
178+
// the scroll bar appears when the subMenu is too long
179+
>.el-menu--popup {
180+
max-height: 100vh;
181+
overflow-y: auto;
182+
183+
&::-webkit-scrollbar-track-piece {
184+
background: #d3dce6;
185+
}
186+
187+
&::-webkit-scrollbar {
188+
width: 6px;
189+
}
190+
191+
&::-webkit-scrollbar-thumb {
192+
background: #99a9bf;
193+
border-radius: 20px;
194+
}
195+
}
177196
}

0 commit comments

Comments
 (0)