| 属性 | 类型 | 必填 | 默认值 | 描述 |
|---|---|---|---|---|
bufferedItemsCount |
number |
✅ | - | 在可见区域前后渲染的缓冲区项目数量 |
emptyListElement |
HTMLElement |
✅ | - | 列表为空时渲染的元素 |
itemHeight |
number |
✅ | - | 每个项目的高度(以像素为单位,假设为固定高度) |
items |
Peer1[] |
✅ | - | 待虚拟化的项目 |
renderItem |
(item: Peer1, index: number) |
✅ | - | 渲染每个项目的函数 |
import { RtkVirtualizedParticipantList } from '@cloudflare/realtimekit-react-ui';
function MyComponent() {
return <RtkVirtualizedParticipantList />;
}import { RtkVirtualizedParticipantList } from '@cloudflare/realtimekit-react-ui';
function MyComponent() {
return (
<RtkVirtualizedParticipantList
bufferedItemsCount={42}
emptyListElement={htmlelement}
itemHeight={42}
/>
);
}