mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-15 17:31:42 +08:00
78abff551d
* feat(module: form): add form-context demo, support FormProvider * refactor: remove debug code Co-authored-by: James Yeung <shunjiey@hotmail.com>
29 lines
855 B
C#
29 lines
855 B
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"
|
|
EditContext="_editContext"
|
|
OnValidSubmit="OnValidSubmit"
|
|
OnInvalidSubmit="OnInvalidSubmit">
|
|
<ObjectGraphDataAnnotationsValidator />
|
|
<CascadingValue Value="this" Name="Form" TValue="IForm">
|
|
@if (!string.IsNullOrEmpty(Size))
|
|
{
|
|
<CascadingValue Value="Size" Name="FormSize">
|
|
@ChildContent(Model)
|
|
</CascadingValue>
|
|
}
|
|
else
|
|
{
|
|
@ChildContent(Model)
|
|
}
|
|
|
|
</CascadingValue>
|
|
</EditForm>
|
|
</Spin> |