diff --git a/src/BootstrapBlazor/Components/Dialog/EditDialog.razor.cs b/src/BootstrapBlazor/Components/Dialog/EditDialog.razor.cs index c33cc60a786..31c479fa6bb 100644 --- a/src/BootstrapBlazor/Components/Dialog/EditDialog.razor.cs +++ b/src/BootstrapBlazor/Components/Dialog/EditDialog.razor.cs @@ -17,7 +17,9 @@ public partial class EditDialog /// 获得/设置 保存回调委托 /// [Parameter] - [NotNull] +#if NET6_0_OR_GREATER + [EditorRequired] +#endif public Func? OnSaveAsync { get; set; } /// @@ -85,11 +87,6 @@ protected override void OnParametersSet() SaveButtonText ??= Localizer[nameof(SaveButtonText)]; } - private async Task OnClickClose() - { - if (OnCloseAsync != null) await OnCloseAsync(); - } - private async Task OnValidSubmitAsync(EditContext context) { if (OnSaveAsync != null) @@ -117,21 +114,15 @@ public async ValueTask ToggleLoading(bool state) { if (FooterTemplate != null) { - builder.OpenComponent?>>(0); - builder.AddAttribute(1, nameof(CascadingValue?>.Value), OnCloseAsync); - builder.AddAttribute(2, nameof(CascadingValue?>.IsFixed), true); - builder.AddAttribute(3, nameof(CascadingValue?>.ChildContent), FooterTemplate(Model)); - builder.CloseComponent(); + builder.AddContent(1, FooterTemplate(Model)); } else { if (!IsTracking) { - builder.OpenComponent