Skip to content

Commit 23d5b3e

Browse files
committed
chore: 增加 ShowTabInHeader 方法
1 parent cf14593 commit 23d5b3e

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/BootstrapBlazor/Components/Layout/Layout.razor

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,15 @@
7979
@CollapseBarTemplate
8080
}
8181
}
82+
@if (ShowTabInHeader)
83+
{
84+
<div class="tabs tabs-chrome">
85+
@if(_tab != null)
86+
{
87+
@_tab.RenderTabHeader
88+
}
89+
</div>
90+
}
8291
@Header
8392
</header>;
8493

src/BootstrapBlazor/Components/Layout/Layout.razor.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,12 @@ public partial class Layout : IHandlerException
345345
[Parameter]
346346
public Func<TabItem, Task<bool>>? OnBeforeShowContextMenu { get; set; }
347347

348+
/// <summary>
349+
/// Gets or sets whether show the tab in header. Default is false.
350+
/// </summary>
351+
[Parameter]
352+
public bool ShowTabInHeader { get; set; }
353+
348354
[Inject]
349355
[NotNull]
350356
private NavigationManager? Navigation { get; set; }

0 commit comments

Comments
 (0)