Attach a dictionary of attributes to the element.
<h3 @attributes="Dictionary">Attribute</h3>
@code {
Dictionary<string, object> Dictionary = new Dictionary<string, object>()
{
{ "example","true" },
{ "score", 10 },
{ "object", new
{
Number = 100,
Text = "Test"
}
}
};
}
<h3 example="true" score="10" object="{ Number = 100, Text = Test }">Attribute</h3>
Set an attribute for a component.
@attribute [Route("/attribute-in-directive-section")]
<h3>AttributeInDirectiveSection</h3>
Will equalize to
@page "/attribute-in-directive-section" <h3>AttributeInDirectiveSection</h3>