For AI agents: the complete documentation index is available at /apps-plugin/docs/llms.txt, the full documentation bundle is available at /apps-plugin/docs/llms-full.txt, and this page is available as Markdown at /apps-plugin/docs/components/view-container/list.md.

list

高性能列表组件,适用于渲染大量数据,支持垂直滚动和按需渲染。

扫码预览

扫码预览 list

Props

属性名类型默认值必填说明
bouncesbooleantrue否是否启用弹性效果(iOS 回弹效果)
childrenReactNode-否子元素
classNamestring-否组件类名
enableNestedScrollbooleanfalse否是否支持嵌套滚动
enableScrollbooleantrue否是否允许滚动
experimentalRecycleStickyItemboolean-否是否回收吸顶元素
idstring-否元素的唯一标识
initialScrollIndexnumber0否列表渲染后自动滚动到的节点位置
itemSnapListItemSnapAlignment-否启用分页效果
keystring | number | null-否React key 属性
layoutIdnumber-1否数据源更新的唯一标识,会在 layoutcomplete 事件中返回
listType"single" | "flow" | "waterfall"'single'否列表的布局类型
lowerThresholdItemCountnumber0否触发滚动到底部的剩余子节点数量阈值
needLayoutCompleteInfobooleanfalse否layoutcomplete 事件是否包含布局信息
needVisibleItemInfobooleanfalse否是否在滚动事件回调参数中包含当前渲染节点的位置信息
onLayoutComplete(event: ListLayoutCompleteEvent) => void-否首屏渲染完成时触发
onScroll(event: ListScrollEvent) => void-否滚动事件
onScrollStateChange(event: ListScrollStateChangeEvent) => void-否滚动状态变化时触发
onScrollToLower(event: ListScrollToLowerEvent) => void-否滚动到底部时触发
onScrollToUpper(event: ListScrollToUpperEvent) => void-否滚动到顶部时触发
onSnap(event: ListSnapEvent) => void-否分页滚动回调
preloadBufferCountnumber0否列表外预加载的节点数量
refRef<NodesRef>-否用于获取组件实例的 ref
scrollBarEnableboolean-否是否显示滚动条
scrollEventThrottlenumber200否滚动事件的回调频率(ms)
scrollOrientation"horizontal" | "vertical"'vertical'否滚动方向和布局方向
spanCountnumber1否列表的列数或行数,仅当 listType 为 'flow' 或 'waterfall' 时有效
stickybooleanfalse否是否允许列表整体吸顶或吸底
stickyOffsetnumber0否吸顶或吸底时的偏移距离(px)
styleCSSProperties-否组件样式
upperThresholdItemCountnumber0否触发滚动到顶部的剩余子节点数量阈值