产品列表
@context.Description
@code {
///
///
///
public sealed partial class ListViews
{
private IEnumerable Products { get; set; } = Enumerable.Empty();
///
///
///
protected override void OnInitialized()
{
base.OnInitialized();
Products = Enumerable.Range(1, 100).Select(i => new Product()
{
ImageUrl = $"https://imgs.sdgxgz.com/images/Pic{i}.jpg",
Description = $"Pic{i}.jpg"
});
}
private Task> OnQueryAsync(QueryPageOptions options)
{
var items = Products.Skip((options.PageIndex - 1) * options.PageItems).Take(options.PageItems);
return Task.FromResult(new QueryData()
{
Items = items,
TotalCount = Products.Count()
});
}
}
///
///
///
internal class Product
{
///
///
///
public string ImageUrl { get; set; } = "";
///
///
///
public string Description { get; set; } = "";
}
}