ant-design-blazor/components/form/FormItem.razor
ldsenow 527f39456b feat(module: form): Add LabelTemplate for FormItem (#1293)
Co-authored-by: Leishi <lluo@octet.com>
2021-04-02 23:10:37 +08:00

29 lines
1010 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=@($"{_prefixCls}-label")>
@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>