Skip to content

Commit db99e09

Browse files
committed
feat: support custom class attribute
1 parent 96c3db5 commit db99e09

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/BootstrapBlazor/Components/Row/Row.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
@inherits BootstrapModuleComponentBase
33
@attribute [BootstrapModuleAutoLoader(AutoInvokeDispose = false)]
44

5-
<div @attributes="@AdditionalAttributes" id="@Id" data-bb-toggle="row" data-bb-type="@RowType.ToDescriptionString()" data-bb-items="@ItemsPerRow.ToDescriptionString()" data-bb-colspan="@ColSpan" class="d-none">
5+
<div @attributes="@AdditionalAttributes" id="@Id" data-bb-toggle="row" data-bb-type="@RowType.ToDescriptionString()" data-bb-items="@ItemsPerRow.ToDescriptionString()" data-bb-colspan="@ColSpan" class="@ClassString">
66
@ChildContent
77
</div>

src/BootstrapBlazor/Components/Row/Row.razor.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
namespace BootstrapBlazor.Components;
77

88
/// <summary>
9-
///
9+
/// Row 组件
1010
/// </summary>
1111
public partial class Row
1212
{
@@ -33,4 +33,8 @@ public partial class Row
3333
/// </summary>
3434
[Parameter]
3535
public RenderFragment? ChildContent { get; set; }
36+
37+
private string? ClassString => CssBuilder.Default("d-none")
38+
.AddClassFromAttributes(AdditionalAttributes)
39+
.Build();
3640
}

0 commit comments

Comments
 (0)