@inherits ErrorBoundary
@inject ISnackbar Snackbar
@if (CurrentException is null)
{
@ChildContent
}
else if (ErrorContent is not null)
{
@ErrorContent(CurrentException)
}
else
{
组件加载或执行时出现了问题。
重试
}
@code {
protected override async Task OnErrorAsync(Exception exception)
{
Snackbar.Add("操作失败,请重试或联系管理员。", Severity.Error);
await base.OnErrorAsync(exception);
}
}