feat: 增加 AdminAlert 组件

This commit is contained in:
Argo-Tianyi 2021-12-25 12:35:29 +08:00
parent 9912d73e70
commit 578bfc6710
2 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,3 @@
<Block Condition="IsDemo">
<Alert Icon="fa fa-warning" Color="Color.Info">@Text</Alert>
</Block>

View File

@ -0,0 +1,25 @@
using BootstrapAdmin.Web.Core;
namespace BootstrapAdmin.Web.Components;
public partial class AdminAlert
{
[Parameter]
public string? Text { get; set; }
private bool IsDemo { get; set; }
[Inject]
[NotNull]
private IDict? DictService { get; set; }
/// <summary>
///
/// </summary>
protected override void OnInitialized()
{
base.OnInitialized();
IsDemo = DictService.IsDemo();
}
}