File tree Expand file tree Collapse file tree 2 files changed +12
-26
lines changed
src/BootstrapBlazor/Components/Input Expand file tree Collapse file tree 2 files changed +12
-26
lines changed Original file line number Diff line number Diff line change 11@namespace BootstrapBlazor.Components
22@inherits DisplayBase <string >
33
4- @if (IsInputGroupLabel )
5- {
6- <div @attributes =" @AdditionalAttributes" class =" @ClassString" style =" @StyleString " required =" @Required" >
7- @if (ChildContent != null )
8- {
9- @ChildContent
10- }
11- else
12- {
13- <span >@DisplayText </span >
14- }
15- </div >
16- }
17- else
18- {
19- <label @attributes =" @AdditionalAttributes" class =" @ClassString" style =" @StyleString " required =" @Required" >
20- @if (ChildContent != null )
21- {
22- @ChildContent
23- }
24- else
25- {
26- @DisplayText
27- }
28- </label >
29- }
4+ <DynamicElement @attributes =" @AdditionalAttributes" TagName =" @TagName" class =" @ClassString" style =" @StyleString " required =" @Required" >
5+ @if (ChildContent != null )
6+ {
7+ @ChildContent
8+ }
9+ else
10+ {
11+ @DisplayText
12+ }
13+ </DynamicElement >
Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ public partial class BootstrapInputGroupLabel
2323 . AddClassFromAttributes ( AdditionalAttributes )
2424 . Build ( ) ;
2525
26+ private string TagName => IsInputGroupLabel ? "div" : "label" ;
27+
2628 /// <summary>
2729 /// 获得/设置 标签宽度 默认 null 未设置自动适应
2830 /// </summary>
You can’t perform that action at this time.
0 commit comments