UNPKG

@zhazhazhu/charge-waterfall

Version:

使用纯TypeScript编写的瀑布流工具插件,定宽不定高。简单好用,配置方便,纯中文提示,即插即用。适用于JS、Vue、React、Angular

21 lines (20 loc) 663 B
import type { TOptions, TDataSource } from "./types"; export default class Waterfall { private options; private items; private imageHeightTrack; private eventStore; constructor(options: TOptions); private init; private initImage; private createContent; private computePosition; private refreshContainerHeight; private resize; /** 触底时的回调函数 */ onReachBottom: (callback?: (() => void) | undefined) => void; /** 触底加载更多 */ loadMore: (dataSource: TDataSource[]) => Promise<void>; /** 销毁监听的scroll事件和resize事件 */ destroy: () => void; }