UNPKG

930 BTypeScriptView Raw
1/// <reference types="react" />
2
3import * as React from 'react';
4import CommonProps from '../util';
5
6export interface VirtualListProps extends React.HTMLAttributes<HTMLElement>, CommonProps {
7 /**
8 * 渲染的子节点
9 */
10 children?: any;
11
12 /**
13 * 最小加载数量
14 */
15 minSize?: number;
16
17 /**
18 * 一屏数量
19 */
20 pageSize?: number;
21
22 /**
23 * 父渲染函数,默认为 (items, ref) => <ul ref={ref}>{items}</ul>
24 */
25 itemsRenderer?: () => void;
26
27 /**
28 * 缓冲区高度
29 */
30 threshold?: number;
31
32 /**
33 * 获取item高度的函数
34 */
35 itemSizeGetter?: () => void;
36
37 /**
38 * 设置跳转位置,需要设置 itemSizeGetter 才能生效, 不设置认为元素等高并取第一个元素高度作为默认高
39 */
40 jumpIndex?: number;
41}
42
43export default class VirtualList extends React.Component<
44 VirtualListProps,
45 any
46> {}