Skip to content

Commit d350a5b

Browse files
committed
fix: 固定侧边栏菜单高度
1 parent 4801b7b commit d350a5b

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/BootstrapBlazor/Components/Layout/Layout.razor

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
}
3030
@if (Menus != null)
3131
{
32-
@RenderMenu(IsFullSide)
32+
@RenderMenu
3333
}
3434
</aside>
3535
<section class="layout-right">
@@ -58,7 +58,7 @@
5858
}
5959
@if (Menus != null)
6060
{
61-
@RenderMenu(IsFullSide)
61+
@RenderMenu
6262
}
6363
</aside>
6464
@RenderMain
@@ -100,9 +100,9 @@
100100
@Header
101101
</header>;
102102

103-
RenderFragment<bool> RenderMenu => hasScroll =>
103+
RenderFragment RenderMenu =>
104104
@<div class="layout-menu">
105-
@if (hasScroll)
105+
@if (IsFixedTabHeader || IsFullSide)
106106
{
107107
<Scroll>
108108
<Menu Items="@Menus" IsVertical="true" IsAccordion="@IsAccordion" OnClick="ClickMenu"></Menu>

src/BootstrapBlazor/Components/Layout/Layout.razor.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,10 @@
241241
overflow: auto;
242242
}
243243
}
244+
245+
.layout-menu {
246+
height: calc(var(--bb-layout-height) - var(--bb-layout-header-height) - var(--bb-layout-footer-height));
247+
}
244248
}
245249
}
246250

0 commit comments

Comments
 (0)