File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
src/BootstrapBlazor.Server/Components/Components Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 66 <p >@( new MarkupString (Introduction )) </p >
77
88 <div class =" card" >
9- <div class =" card-body" >
9+ <div class =" card-body" style = " @ BodyStyleString " >
1010 @ChildContent
1111 </div >
1212 @if (ShowCode )
Original file line number Diff line number Diff line change 66namespace BootstrapBlazor . Server . Components . Components ;
77
88/// <summary>
9- ///
9+ /// DemoBlock 组件
1010/// </summary>
1111public sealed partial class DemoBlock
1212{
@@ -47,13 +47,23 @@ public sealed partial class DemoBlock
4747 [ Parameter ]
4848 public string ? Name { get ; set ; }
4949
50+ /// <summary>
51+ /// 获得/设置 CardBody 高度 默认 null
52+ /// </summary>
53+ [ Parameter ]
54+ public string ? Height { get ; set ; }
55+
5056 [ CascadingParameter ( Name = "RazorFileName" ) ]
5157 private string ? CodeFile { get ; set ; }
5258
5359 [ Inject ]
5460 [ NotNull ]
5561 private IStringLocalizer < DemoBlock > ? Localizer { get ; set ; }
5662
63+ private string ? BodyStyleString => CssBuilder . Default ( )
64+ . AddClass ( $ "height: { Height } ;", ! string . IsNullOrEmpty ( Height ) )
65+ . Build ( ) ;
66+
5767 /// <summary>
5868 /// <inheritdoc/>
5969 /// </summary>
You can’t perform that action at this time.
0 commit comments