evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
A Vue component that renders a long list of catalog entries using virtualized scrolling and on-demand data loading.
itemSize is a function returning values between 90–110 pixels. @testexport interface CatalogItem {
id: string;
title: string;
price: number;
}
export interface VirtualizedCatalogProps {
/** Preloaded items currently available for rendering. */
items: CatalogItem[];
/** Total number of records available on the server. */
totalRecords: number;
/** Number of records to request per lazy load. */
pageSize: number;
/** Fixed row height or a function that estimates per-item height in pixels. */
itemSize: number | ((item: CatalogItem) => number);
/** Optional flag to show a loader row while external fetch is in-flight. */
loading?: boolean;
/** Triggered when more data is needed; receives the requested range. */
loadMore: (range: { first: number; last: number }) => Promise<CatalogItem[]>;
}
export interface VirtualizedCatalogSlots {
/** Renders each visible row. */
item: (item: CatalogItem, index: number) => unknown;
/** Renders a loading row while lazy data is fetching. */
loading?: () => unknown;
/** Renders when no items are available yet. */
empty?: () => unknown;
}Provides virtualized scrolling and lazy loading primitives for long lists.