waterfalljs-layout
Version:
js实现瀑布流布局、React瀑布流布局组件
35 lines (34 loc) • 860 B
TypeScript
import type { IwaterfallProps } from "./type";
declare type Ilistobj = {
index: number;
bottom: number;
height: number;
};
export default class Waterfall {
config: IwaterfallProps;
container: HTMLElement;
containerWidth: number;
columnCount: number;
liLeft: number;
liNodes: HTMLElement[];
itemList: Ilistobj[];
colList: Ilistobj[][];
handleTimer: any;
ulMaxH: number;
prevImageLength: number;
prevLiNodesLength: number;
lastItemsBottom: number[];
constructor(config: IwaterfallProps);
init(): void;
/**
* 初始化数据或加载更多时调用
*/
load(): void;
initLayout(): void;
refreshLayout(): void;
renderView(): void;
loadImages(): Promise<any>;
initPolling(): void;
pollingRefresh(): void;
}
export {};