Skip to content

Commit fca60d9

Browse files
committed
refactor: 增加异常对话框扩展方法
1 parent 745c99f commit fca60d9

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/BootstrapBlazor/Extensions/DialogServiceExtensions.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,4 +226,22 @@ public static async Task ShowValidateFormDialog<TComponent>(this DialogService s
226226
configureOption?.Invoke(option);
227227
await service.Show(option, dialog);
228228
}
229+
230+
/// <summary>
231+
/// 显示异常信息对话框扩展方法
232+
/// </summary>
233+
/// <param name="service"></param>
234+
/// <param name="fragment"></param>
235+
/// <param name="dialog"></param>
236+
/// <returns></returns>
237+
public static async Task ShowErrorHandlerDialog(this DialogService service, RenderFragment fragment, Dialog? dialog = null)
238+
{
239+
var option = new DialogOption
240+
{
241+
Title = "Error",
242+
IsScrolling = true,
243+
BodyTemplate = fragment
244+
};
245+
await service.Show(option, dialog);
246+
}
229247
}

0 commit comments

Comments
 (0)