-
-
Notifications
You must be signed in to change notification settings - Fork 382
Expand file tree
/
Copy pathAlertBase.cs
More file actions
63 lines (55 loc) · 2.04 KB
/
AlertBase.cs
File metadata and controls
63 lines (55 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License
// See the LICENSE file in the project root for more information.
// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone
namespace BootstrapBlazor.Components;
/// <summary>
/// <para lang="zh">Alert 警告框组件</para>
/// <para lang="en">Alert component</para>
/// </summary>
public abstract class AlertBase : BootstrapComponentBase
{
/// <summary>
/// <para lang="zh">获得 图标样式字符串</para>
/// <para lang="en">Gets the icon class string</para>
/// </summary>
protected string? IconString => CssBuilder.Default("alert-icon")
.AddClass(Icon)
.Build();
/// <summary>
/// <para lang="zh">获得/设置 颜色</para>
/// <para lang="en">Gets or sets the color</para>
/// </summary>
[Parameter]
public Color Color { get; set; } = Color.Primary;
/// <summary>
/// <para lang="zh">获得/设置 是否显示关闭按钮</para>
/// <para lang="en">Gets or sets whether to show the dismiss button</para>
/// </summary>
[Parameter]
public bool ShowDismiss { get; set; }
/// <summary>
/// <para lang="zh">获得/设置 显示图标</para>
/// <para lang="en">Gets or sets the icon</para>
/// </summary>
[Parameter]
public string? Icon { get; set; }
/// <summary>
/// <para lang="zh">获得/设置 是否显示左侧 Bar</para>
/// <para lang="en">Gets or sets whether to show the left bar</para>
/// </summary>
[Parameter]
public bool ShowBar { get; set; }
/// <summary>
/// <para lang="zh">子组件</para>
/// <para lang="en">Child content</para>
/// </summary>
[Parameter]
public RenderFragment? ChildContent { get; set; }
/// <summary>
/// <para lang="zh">关闭警告框回调方法</para>
/// <para lang="en">Callback method when the alert is dismissed</para>
/// </summary>
[Parameter]
public Func<Task>? OnDismiss { get; set; }
}