I want to assign a class
attribute to <InputDate />
component. I tried using AdditionalAttributes
but its syntax is not clear to me. What I ended up with is this:
<InputDate @bind-Value="Model.Task.TaskDate" @attributes="datePickerAttributes" />
@code {
private Dictionary<string,object> datePickerAttributes = new Dictionary<string, object>()
{
["class"] = "form-control"
};
}
It works but looks messy.
Is there a more concise way to achieve the same result?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…