ant-design-blazor/components/list/AntList.razor

62 lines
1.6 KiB
C#
Raw Normal View History

@namespace AntDesign
2020-05-03 21:46:21 +08:00
@inherits AntDomComponentBase
2020-05-21 14:49:07 +08:00
@typeparam TItem
2020-05-03 21:46:21 +08:00
2020-05-21 14:49:07 +08:00
<div class="@ClassMapper.Class" style="@Style" Id="@Id">
2020-05-03 21:46:21 +08:00
2020-05-21 14:49:07 +08:00
@if (Header != null)
{
<div class="@PrefixName-header">
@Header
</div>
}
@if (DataSource != null && DataSource.Any())
{
<Spin Spinning="Loading">
@if (Grid != null)
{
<Row Gutter="Grid.Gutter">
@foreach (var item in DataSource)
{
<CascadingValue Value="ItemLayout">
<CascadingValue Value="()=>HandleItemClick(item)" TValue="Action" Name="ItemClick">
@ChildContent(item)
</CascadingValue>
</CascadingValue>
}
</Row>
}
else
{
<ul class="ant-list-items">
@foreach (var item in DataSource)
{
<CascadingValue Value="ItemLayout">
<CascadingValue Value="()=>HandleItemClick(item)" TValue="Action" Name="ItemClick">
@ChildContent(item)
</CascadingValue>
</CascadingValue>
}
</ul>
}
2020-05-21 14:49:07 +08:00
</Spin>
}
else
{
<div style="min-height:53px" />
}
2020-05-03 21:46:21 +08:00
2020-05-21 14:49:07 +08:00
@if (Footer != null)
{
<div class="@PrefixName-footer">
@Footer
2020-05-03 21:46:21 +08:00
</div>
2020-05-21 14:49:07 +08:00
}
@if (LoadMore != null)
{
@LoadMore
}
</div>