Skip to content

Commit b6d7990

Browse files
committed
feat(Layout): add OnTabHeaderTextLocalizer parameter
1 parent 986f8d5 commit b6d7990

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/BootstrapBlazor/Components/Layout/Layout.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@
138138
ShowExtendButtons="ShowTabExtendButtons" ShowClose="ShowTabItemClose" AllowDrag="AllowDragTab"
139139
DefaultUrl="@TabDefaultUrl" ExcludeUrls="@ExcludeUrls" IsOnlyRenderActiveTab="IsOnlyRenderActiveTab"
140140
TabStyle="TabStyle" ShowToolbar="@ShowToolbar" ToolbarTemplate="@ToolbarTemplate"
141-
ShowContextMenu="ShowTabContextMenu"
141+
ShowContextMenu="ShowTabContextMenu" OnTabHeaderTextLocalizer="OnTabHeaderTextLocalizer"
142142
BeforeContextMenuTemplate="@BeforeTabContextMenuTemplate" ContextMenuTemplate="@TabContextMenuTemplate"
143143
ContextMenuRefreshIcon="@TabContextMenuRefreshIcon" ContextMenuCloseIcon="@TabContextMenuCloseIcon"
144144
ContextMenuCloseOtherIcon="@TabContextMenuCloseOtherIcon" ContextMenuCloseAllIcon="@TabContextMenuCloseAllIcon"

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ public partial class Layout : IHandlerException, ITabHeader
1818
{
1919
private bool IsSmallScreen { get; set; }
2020

21+
/// <summary>
22+
/// 获得/设置 Tab 标签头文本本地化回调方法
23+
/// </summary>
24+
[Parameter]
25+
public Func<string?, string?>? OnTabHeaderTextLocalizer { get; set; }
26+
2127
/// <summary>
2228
/// Gets or sets the tab style. Default is <see cref="TabStyle.Default"/>.
2329
/// </summary>

0 commit comments

Comments
 (0)