Skip to content

Commit 2561de8

Browse files
committed
feat(DateTimePicker):DateTimePicker增加Color样式属性
DateTimePicker增加Color样式属性,默认Color.None
1 parent 889410f commit 2561de8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/BootstrapBlazor/Components/DateTimePicker/DateTimePicker.razor.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public partial class DateTimePicker<TValue>
2727
/// </summary>
2828
private string? InputClassName => CssBuilder.Default("dropdown-toggle form-control datetime-picker-input")
2929
.AddClass("has-icon", ShowIcon)
30+
.AddClass($"border-{Color.ToDescriptionString()}", Color != Color.None && !IsDisabled && !IsValid.HasValue)
3031
.AddClass(ValidCss)
3132
.Build();
3233

@@ -105,6 +106,12 @@ public string? Format
105106
[Parameter]
106107
public bool ShowIcon { get; set; } = true;
107108

109+
/// <summary>
110+
/// 获得/设置 控件边框颜色样式 默认为 None 显示
111+
/// </summary>
112+
[Parameter]
113+
public Color Color { get; set; } = Color.None;
114+
108115
/// <summary>
109116
/// 获得/设置 组件显示模式 默认为显示年月日模式
110117
/// </summary>

0 commit comments

Comments
 (0)