mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-04 21:17:36 +08:00
40 lines
1.2 KiB
C#
40 lines
1.2 KiB
C#
@namespace AntDesign
|
|
@inherits AntDomComponentBase
|
|
@typeparam TModel
|
|
@using Microsoft.AspNetCore.Components.Forms;
|
|
@using AntDesign.Internal;
|
|
|
|
<Spin Spinning="Loading">
|
|
<EditForm class="@ClassMapper.Class"
|
|
style="@Style"
|
|
id="@Id"
|
|
method="@Method"
|
|
FormName="@Name"
|
|
Enhance="@Enhance"
|
|
autocomplete="@Autocomplete"
|
|
EditContext="_editContext"
|
|
OnValidSubmit="OnValidSubmit"
|
|
OnInvalidSubmit="OnInvalidSubmit">
|
|
@if(ValidateMode.IsIn(FormValidateMode.Rules, FormValidateMode.Complex))
|
|
{
|
|
<FormRulesValidator @ref="_rulesValidator" />
|
|
}
|
|
@if (ValidateMode.IsIn(FormValidateMode.Default, FormValidateMode.Complex))
|
|
{
|
|
@Validator
|
|
}
|
|
<CascadingValue Value="this" Name="Form" TValue="IForm" IsFixed="@true">
|
|
@if (!string.IsNullOrEmpty(Size))
|
|
{
|
|
<CascadingValue Value="Size" Name="FormSize">
|
|
@ChildContent(Model)
|
|
</CascadingValue>
|
|
}
|
|
else
|
|
{
|
|
@ChildContent(Model)
|
|
}
|
|
|
|
</CascadingValue>
|
|
</EditForm>
|
|
</Spin> |