-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
area-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing one
Milestone
Description
Is your feature request related to a problem? Please describe.
Support enumarable of RenderFragment and RenderFragment<T> in components.
Describe the solution you'd like
List.razor:
<ul>
@foreach (var item in Items)
{
<li>@item</li>
}
</ul>
@code {
[Parameter(Tag = "Item")]
public IEnumerable<RenderFragment> Items { get; set; }
}Page.razor:
<List>
<Item>Item 1</Item>
<Item>Item 2</Item>
<Item>Item 3</Item>
</List>Additional context
Enumerables members usually are written in plural form, but in the usage, the singular form is more accurate. I propose add a parameter in [Parameter] attribute to specify the tag. This proposal should be available to any parameter like this:
Person.razor
[Parameter(Tag = "Name")]
public string FullName { get; set; }Page.razor
<Person Name="Ivan" />Metadata
Metadata
Assignees
Labels
area-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing one