Skip to content

Commit 1972c70

Browse files
authored
fix(Layout): update layout-menu style (#4803)
* fix: 固定侧边栏菜单高度 * doc: 更新示例 * doc: 更新样式 * style: 更新侧边栏菜单高度样式
1 parent 4801b7b commit 1972c70

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

src/BootstrapBlazor.Shared/Components/Samples/Layouts.razor

+6-6
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
Introduction="@Localizer["LayoutsUpAndDownIntro"]"
4141
Name="UpAndDown">
4242
<div class="layout-demo">
43-
<Layout ShowFooter="true">
43+
<Layout ShowFooter="true" AdditionalAssemblies="[typeof(MainLayout).Assembly]">
4444
<Header>
4545
<div>Header</div>
4646
</Header>
@@ -58,7 +58,7 @@
5858
Introduction="@Localizer["LayoutsMiddleLeftRightIntro"]"
5959
Name="MiddleLeftRight">
6060
<div class="layout-demo">
61-
<Layout ShowFooter="true">
61+
<Layout ShowFooter="true" AdditionalAssemblies="[typeof(MainLayout).Assembly]">
6262
<Header>
6363
<div>Header</div>
6464
</Header>
@@ -79,7 +79,7 @@
7979
Introduction="@Localizer["LayoutsLeftRightIntro"]"
8080
Name="LeftRight">
8181
<div class="layout-demo">
82-
<Layout ShowFooter="true" IsFullSide="true">
82+
<Layout ShowFooter="true" IsFullSide="true" AdditionalAssemblies="[typeof(MainLayout).Assembly]">
8383
<Header>
8484
<div>Header</div>
8585
</Header>
@@ -100,7 +100,7 @@
100100
Introduction="@Localizer["LayoutsCustomPercentIntro"]"
101101
Name="CustomPercent">
102102
<div class="layout-demo">
103-
<Layout ShowFooter="true" SideWidth="200">
103+
<Layout ShowFooter="true" SideWidth="200" AdditionalAssemblies="[typeof(MainLayout).Assembly]">
104104
<Header>
105105
<div>Header</div>
106106
</Header>
@@ -140,7 +140,7 @@
140140
@((MarkupString)Localizer["LayoutsAppTips7"].Value)
141141
</Tips>
142142
<div class="layout-demo1">
143-
<Layout ShowFooter="true" SideWidth="160px" Menus="IconSideMenuItems1">
143+
<Layout ShowFooter="true" SideWidth="160px" Menus="IconSideMenuItems1" AdditionalAssemblies="[typeof(MainLayout).Assembly]">
144144
<Header>
145145
<div>Header</div>
146146
</Header>
@@ -158,7 +158,7 @@
158158
@Localizer["LayoutsAppTips8"]
159159
</p>
160160
<div class="layout-demo2">
161-
<Layout ShowFooter="true" SideWidth="160px" Menus="IconSideMenuItems2">
161+
<Layout ShowFooter="true" SideWidth="160px" Menus="IconSideMenuItems2" AdditionalAssemblies="[typeof(MainLayout).Assembly]">
162162
<Header>
163163
<div>Header</div>
164164
</Header>

src/BootstrapBlazor/Components/Layout/Layout.razor

+4-4
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

+5
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@
233233
}
234234

235235
&.is-fixed-tab {
236+
.layout-menu,
236237
.tabs {
237238
height: calc(var(--bb-layout-height) - var(--bb-layout-header-height) - var(--bb-layout-footer-height));
238239

@@ -278,6 +279,10 @@
278279
top: 0;
279280
height: var(--bb-layout-height);
280281
}
282+
283+
.layout-menu {
284+
height: calc(var(--bb-layout-height) - var(--bb-layout-header-height));
285+
}
281286
}
282287
}
283288

0 commit comments

Comments
 (0)