refactor: 重构 AdminAlert 组件
This commit is contained in:
parent
99b6da65af
commit
35339d7ebf
|
@ -1,3 +1,12 @@
|
|||
<Block Condition="IsDemo">
|
||||
<Alert Icon="fa fa-warning" Color="Color.Info">@Text</Alert>
|
||||
<Alert Icon="fa fa-warning" Color="@Color">
|
||||
@if (ChildContent != null)
|
||||
{
|
||||
@ChildContent
|
||||
}
|
||||
else
|
||||
{
|
||||
@Text
|
||||
}
|
||||
</Alert>
|
||||
</Block>
|
||||
|
|
|
@ -7,6 +7,12 @@ public partial class AdminAlert
|
|||
[Parameter]
|
||||
public string? Text { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public RenderFragment? ChildContent { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public Color Color { get; set; } = Color.Danger;
|
||||
|
||||
private bool IsDemo { get; set; }
|
||||
|
||||
[Inject]
|
||||
|
|
Loading…
Reference in New Issue