Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/BootstrapBlazor/BootstrapBlazor.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup Condition="'$(VisualStudioVersion)' == '17.0'">
<Version>9.12.1</Version>
<Version>9.12.2-beta01</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(VisualStudioVersion)' == '18.0'">
Expand Down
11 changes: 11 additions & 0 deletions src/BootstrapBlazor/Components/Tab/Tab.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ public partial class Tab
[Parameter]
public bool IsLazyLoadTabItem { get; set; }

/// <summary>
/// 获得/设置 Tab 标签头文本本地化回调方法
/// </summary>
[Parameter]
public Func<string?, string?>? OnTabHeaderTextLocalizer { get; set; }

/// <summary>
/// 获得/设置 组件高度 默认值为 0 高度自动
/// </summary>
Expand Down Expand Up @@ -862,6 +868,11 @@ private void AddTabItem(string url)

void SetTabItemParameters(string? text, string? icon, bool closable, bool active)
{
// 增加 TabItemOptionAttribute 多语言支持
if (OnTabHeaderTextLocalizer != null)
{
text = OnTabHeaderTextLocalizer(text);
}
parameters.Add(nameof(TabItem.Text), text);
parameters.Add(nameof(TabItem.Icon), icon);
parameters.Add(nameof(TabItem.Closable), closable);
Expand Down
Loading