Skip to content

Commit 06aa586

Browse files
committed
feat: 增加 ToolbarTemplate 参数
1 parent f57315d commit 06aa586

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

src/BootstrapBlazor/Components/Table/Table.razor

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@
6969
@TableToolbarTemplate
7070
}
7171
</TableToolbar>
72+
@if (ToolbarTemplate != null)
73+
{
74+
<div class="float-start table-toolbar-template">
75+
@ToolbarTemplate
76+
</div>
77+
}
7278
<div class="float-end table-toolbar-button btn-group table-column-right">
7379
@if (TableExtensionToolbarBeforeTemplate != null)
7480
{

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ public partial class Table<TItem>
1515
[Parameter]
1616
public bool ShowToolbar { get; set; }
1717

18+
/// <summary>
19+
/// Gets or sets the template of table toolbar. Default is null.
20+
/// </summary>
21+
[Parameter]
22+
public RenderFragment? ToolbarTemplate { get; set; }
23+
1824
/// <summary>
1925
/// 获得/设置 首次加载是否显示加载骨架屏 默认 false 不显示 使用 <see cref="ShowLoadingInFirstRender" /> 参数值
2026
/// </summary>

src/BootstrapBlazor/Components/Table/Table.razor.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,15 @@ form .table .table-cell > textarea {
711711
}
712712
}
713713

714+
.table-toolbar-template {
715+
margin-block-end: .5rem;
716+
min-height: 35px;
717+
display: flex;
718+
flex-wrap: nowrap;
719+
align-items: center;
720+
justify-content: flex-start;
721+
}
722+
714723
@media (min-width: 576px) {
715724
.table-search .card-header .card-title {
716725
display: initial;

0 commit comments

Comments
 (0)