diff --git a/src/BootstrapBlazor/Components/Row/Row.razor b/src/BootstrapBlazor/Components/Row/Row.razor
index 548b40cc903..df9bd6422a5 100644
--- a/src/BootstrapBlazor/Components/Row/Row.razor
+++ b/src/BootstrapBlazor/Components/Row/Row.razor
@@ -2,6 +2,6 @@
@inherits BootstrapModuleComponentBase
@attribute [BootstrapModuleAutoLoader(AutoInvokeDispose = false)]
-
+
@ChildContent
diff --git a/src/BootstrapBlazor/Components/Row/Row.razor.cs b/src/BootstrapBlazor/Components/Row/Row.razor.cs
index da4b31689a4..78b8b4e9810 100644
--- a/src/BootstrapBlazor/Components/Row/Row.razor.cs
+++ b/src/BootstrapBlazor/Components/Row/Row.razor.cs
@@ -6,7 +6,7 @@
namespace BootstrapBlazor.Components;
///
-///
+/// Row 组件
///
public partial class Row
{
@@ -33,4 +33,8 @@ public partial class Row
///
[Parameter]
public RenderFragment? ChildContent { get; set; }
+
+ private string? ClassString => CssBuilder.Default("d-none")
+ .AddClassFromAttributes(AdditionalAttributes)
+ .Build();
}
diff --git a/test/UnitTest/Components/RowTest.cs b/test/UnitTest/Components/RowTest.cs
index 0a94eabe2a3..39087e9c56a 100644
--- a/test/UnitTest/Components/RowTest.cs
+++ b/test/UnitTest/Components/RowTest.cs
@@ -14,9 +14,14 @@ public void RowType_Normal()
{
pb.Add(a => a.RowType, RowType.Normal);
pb.Add(a => a.ChildContent, CreateContent());
+ pb.Add(a => a.AdditionalAttributes, new Dictionary
()
+ {
+ { "class", "test-row" }
+ });
});
Assert.Contains("data-bb-type=\"row\"", cut.Markup);
+ Assert.Contains("class=\"d-none test-row\"", cut.Markup);
}
[Fact]