Skip to content

Commit 2338e22

Browse files
committed
feat: 增加报错功能
1 parent 2afc4b9 commit 2338e22

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/BootstrapBlazor/Components/Watermark/Watermark.razor.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ protected override void OnParametersSet()
7272
base.OnParametersSet();
7373

7474
Text ??= "BootstrapBlazor";
75+
76+
if(IsPage && ChildContent is not null)
77+
{
78+
throw new InvalidOperationException($"{nameof(IsPage)} is true, {nameof(ChildContent)} cannot be set.");
79+
}
7580
}
7681

7782
/// <summary>

0 commit comments

Comments
 (0)