How to use the @egjs/infinitegrid.categorize function in @egjs/infinitegrid

To help you get started, we’ve selected a few @egjs/infinitegrid examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github naver / egjs-infinitegrid / packages / vue-infinitegrid / src / InfiniteGrid.ts View on Github external
const nativeIG = this.$_nativeInfiniteGrid;
		const items = this.$_toItems();

		let visibleChildren: VNode[] = [];
		if (nativeIG) {
			const result = nativeIG.beforeSync(items.filter(val => !val.isLoading));
			this.$_layout = result === "relayout"
				? result
				: (this.$_layout || result);

			visibleChildren = nativeIG.getRenderingItems().map(item => item.vnode);
			if (this.$slots.loading && nativeIG.isLoading()) {
				visibleChildren.push(...this.$slots.loading);
			}
		} else {
			const groups = categorize(items);
			if (this.status) {
				const { startCursor, endCursor } = this.status._infinite;

				visibleChildren = ItemManager.pluck(
					groups.slice(startCursor, endCursor + 1),
					"items",
				).map((item: IItem) => item.vnode);
			} else if (this.useFirstRender && groups[0]) {
				visibleChildren = groups[0].items.map((item: IItem) => item.vnode);
			}
		}

		// To bypass
		// [Vue warn]: Avoid using observed data object as vnode data: {}
		const wrapperData = {};
		for (const key in this.wrapperData) {

@egjs/infinitegrid

A module used to arrange elements including content infinitely according to grid type. With this module, you can implement various grids composed of different card elements whose sizes vary. It guarantees performance by maintaining the number of DOMs the

MIT
Latest version published 6 months ago

Package Health Score

73 / 100
Full package analysis