ant-design-blazor/components/form/FormItem.razor

29 lines
1.0 KiB
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() style="@LabelStyle">@(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>