API Reference
@univerjs
@univerjs/ui
functions
Usevirtuallist

@univerjs/ui v0.2.14Docs


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

packages/ui/src/components/hooks/virtual-list.ts:38 (opens in a new tab)


Copyright © 2021-2024 DreamNum Co,Ltd. All Rights Reserved.