SxInfiniteList (无限滚动列表)

  • Implemented

高性能长列表容器,支持自动触底加载。对齐 NextUI 扩展 规范,并说明当前实现能力。

使用场景

  • 超长列表的按需渲染
  • 无限滚动加载列表
  • 数据密集型列表展示

约束说明

  • ItemContent 为必填渲染模板。
  • ItemHeight 使用 rem 作为高度单位。

行为说明

  • OnLoadMore 在触发哨兵区域时执行。
  • Loading 为真时显示加载状态。

API

Parameters (参数)

状态 参数名 类型 默认值 描述
Implemented Items IEnumerable<TItem> Enumerable.Empty<TItem>() 初始数据源。
Implemented ItemContent RenderFragment<TItem> null 列表项渲染模版。
Implemented ItemHeight float 3.0 每行高度 (rem)。
Implemented OverscanCount int 5 预渲染行数。
Implemented OnLoadMore EventCallback null 触底加载回调。
Implemented Disabled (继承) bool false 禁用状态。
Implemented Loading (继承) bool false 加载状态。
Implemented Id (继承) string? null 组件的物理 Id。
Implemented Class (继承) string? null 自定义 CSS 类名。
Implemented Style (继承) string? null 自定义样式。
Implemented Title (继承) string? null HTML title 属性。
Implemented AdditionalAttributes (继承) IEnumerable<KeyValuePair<string, object>>? null 捕获不匹配的 HTML 属性。

Events (事件)

状态 事件名 类型 描述
Implemented OnLoadMore EventCallback 滚动到底部时触发。

示例

<SxInfiniteList Items="_items" ItemHeight="3">
    <ItemContent Context="item">
        <SxTypography>@item</SxTypography>
    </ItemContent>
</SxInfiniteList>

参考设计 (References)