@univerjs/ui v0.5.0-beta.1Docs


Function: useVirtualList()

function useVirtualList<T>(list, options): readonly [{
  data: T;
  index: number;
 }[], {
  containerProps: {
     onScroll: (e) => void;
    };
  scrollTo: (index) => void;
  wrapperStyle: {
     height: undefined | string;
     marginTop: undefined | string;
    };
 }]

Type Parameters

Type Parameter
T

Parameters

ParameterType
listT[]
optionsIVirtualListOptions<T>

Returns

readonly [{ data: T; index: number; }[], { containerProps: { onScroll: (e) => void; }; scrollTo: (index) => void; wrapperStyle: { height: undefined | string; marginTop: undefined | string; }; }]

Defined in

submodules/univer/packages/ui/src/components/hooks/virtual-list.ts:38