ant-design-blazor/components/form/FormItem.razor
2021-04-08 22:32:48 +08:00

29 lines
1012 B
C#

@namespace AntDesign
@inherits AntDomComponentBase
@using AntDesign.Internal;
<Row class="@ClassMapper.Class" style="@Style" id="@Id">
@if (!string.IsNullOrEmpty(Label) || LabelTemplate != null)
{
<AntDesign.Col @attributes="GetLabelColAttributes()" Class="@_labelClassMapper.Class">
@if (LabelTemplate != null)
{
@LabelTemplate
}
else
{
<label class=@GetLabelClass()>@(Label)</label>
}
</AntDesign.Col>
}
<AntDesign.Col @attributes="GetWrapperColAttributes()" Class=@($"{_prefixCls}-control")>
<div class=@($"{_prefixCls}-control-input")>
<div class=@($"{_prefixCls}-control-input-content")>
<CascadingValue Value="this" Name="FormItem" TValue="IFormItem" IsFixed="@true">
@ChildContent
</CascadingValue>
</div>
</div>
@_formValidationMessages
</AntDesign.Col>
</Row>