mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-05 05:27:37 +08:00
24 lines
640 B
C#
24 lines
640 B
C#
using Microsoft.AspNetCore.Components;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace AntDesign
|
|
{
|
|
public static class RenderFragmentHelper
|
|
{
|
|
public static RenderFragment ToRenderFragment(this string value) => builder => builder.AddContent(1, value);
|
|
|
|
public static RenderFragment ForeachLoop<TItem>(this IEnumerable<TItem> items, RenderFragment<TItem> childContent)
|
|
{
|
|
return builder =>
|
|
{
|
|
foreach (var item in items)
|
|
{
|
|
childContent(item)(builder);
|
|
}
|
|
};
|
|
}
|
|
}
|
|
}
|