@{
var index = 1;
}
@foreach (var item in Items)
{
@Template.WithValue(new Context() { Index = index++, Item = item, });
}
@functions{
[Parameter] IEnumerable Items { get; set; }
[Parameter] RenderFragment Template { get; set; }
public class Context
{
public int Index { get; set; }
public string Item { get; set; }
}
}