File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed
src/BootstrapBlazor/Components/Row Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change 66namespace BootstrapBlazor . Components ;
77
88/// <summary>
9- ///
9+ /// Row 组件
1010/// </summary>
1111public 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}
Original file line number Diff line number Diff line change @@ -14,9 +14,14 @@ public void RowType_Normal()
1414 {
1515 pb . Add ( a => a . RowType , RowType . Normal ) ;
1616 pb . Add ( a => a . ChildContent , CreateContent ( ) ) ;
17+ pb . Add ( a => a . AdditionalAttributes , new Dictionary < string , object > ( )
18+ {
19+ { "class" , "test-row" }
20+ } ) ;
1721 } ) ;
1822
1923 Assert . Contains ( "data-bb-type=\" row\" " , cut . Markup ) ;
24+ Assert . Contains ( "class=\" d-none test-row\" " , cut . Markup ) ;
2025 }
2126
2227 [ Fact ]
You can’t perform that action at this time.
0 commit comments