Skip to content

Commit 92062a5

Browse files
committed
feat: 增加 Color/Text 参数
1 parent 8c329b9 commit 92062a5

5 files changed

Lines changed: 20 additions & 4 deletions

File tree

src/BootstrapBlazor/Components/Table/Table.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@
10411041
</td>;
10421042

10431043
RenderFragment<TItem> RenderMoreButton => item =>
1044-
@<Dropdown TValue="string" Color="Color.Secondary" IsFixedButtonText="true" FixedButtonText="更多"
1044+
@<Dropdown TValue="string" Color="@MoreButtonColor" IsFixedButtonText="true" FixedButtonText="@MoreButtonText"
10451045
Size="Size.ExtraSmall" IsPopover="true" Icon="@MoreButtonIcon">
10461046
<ItemsTemplate>
10471047
@if (MoreButtonDropdownTemplate != null)

src/BootstrapBlazor/Components/Table/Table.razor.Edit.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the Apache 2.0 License
33
// See the LICENSE file in the project root for more information.
44
// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone
@@ -157,6 +157,18 @@ public partial class Table<TItem>
157157
[Parameter]
158158
public bool ShowMoreButton { get; set; }
159159

160+
/// <summary>
161+
/// 获得/设置 更多按钮颜色 默认 <see cref="Color.Secondary"/>
162+
/// </summary>
163+
[Parameter]
164+
public Color MoreButtonColor { get; set; } = Color.Secondary;
165+
166+
/// <summary>
167+
/// 获得/设置 更多按钮文本 默认 null 读取资源文件设置文本
168+
/// </summary>
169+
[Parameter]
170+
public string? MoreButtonText { get; set; }
171+
160172
/// <summary>
161173
/// 获得/设置 行内更多按钮下拉框模板 默认 null
162174
/// </summary>

src/BootstrapBlazor/Components/Table/Table.razor.Localization.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,5 +434,7 @@ private void OnInitLocalization()
434434
AlignCenterTooltipText ??= Localizer[nameof(AlignCenterTooltipText)];
435435
AlignRightText ??= Localizer[nameof(AlignRightText)];
436436
AlignRightTooltipText ??= Localizer[nameof(AlignRightTooltipText)];
437+
438+
MoreButtonText ??= Localizer[nameof(MoreButtonText)];
437439
}
438440
}

src/BootstrapBlazor/Locales/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,8 @@
256256
"AlignRightText": "Right",
257257
"AlignRightTooltipText": "Click to align text in this column to the right",
258258
"ColumnListSelectAllText": "All",
259-
"ColumnListSelectInvertText": "Invert"
259+
"ColumnListSelectInvertText": "Invert",
260+
"MoreButtonText": "More"
260261
},
261262
"BootstrapBlazor.Components.EditDialog": {
262263
"CloseButtonText": "Close",

src/BootstrapBlazor/Locales/zh.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,8 @@
256256
"AlignRightText": "右对齐",
257257
"AlignRightTooltipText": "点击后本列文本右对齐",
258258
"ColumnListSelectAllText": "全选",
259-
"ColumnListSelectInvertText": "反选"
259+
"ColumnListSelectInvertText": "反选",
260+
"MoreButtonText": "更多"
260261
},
261262
"BootstrapBlazor.Components.EditDialog": {
262263
"CloseButtonText": "关闭",

0 commit comments

Comments
 (0)