UNPKG

@crcong/wc-waterfall

Version:

wc-waterfall is a flow layout component written using web-component

42 lines (38 loc) 853 B
type Props = { cols: number; 'gap-x': number; 'gap-y': number; }; /** * 瀑布流布局 * * @example * const layout = useWaterfall(div, { cols: 4, gap: 4 }) * layout.mount() */ declare const useWaterfall: (el: HTMLElement, props: Props) => { relayout: () => void; mount: () => void; unmount: () => void; }; declare const WaterfallElement_base: new () => { $props: { cols: number; 'gap-x': number; 'gap-y': number; }; render(): void; } & { cols: number; 'gap-x': number; 'gap-y': number; } & HTMLElement; declare class WaterfallElement extends WaterfallElement_base { constructor(); _layout: ReturnType<typeof useWaterfall>; connectedCallback(): void; disconnectedCallback(): void; /**update layout */ render(): void; } export { WaterfallElement };