diff --git a/components/vc-virtual-list/hooks/useHeights.tsx b/components/vc-virtual-list/hooks/useHeights.tsx index 634afc293a..8cf6e69eb6 100644 --- a/components/vc-virtual-list/hooks/useHeights.tsx +++ b/components/vc-virtual-list/hooks/useHeights.tsx @@ -11,10 +11,9 @@ export default function useHeights( onItemRemove?: ((item: T) => void) | null, ): [(item: T, instance: HTMLElement) => void, () => void, CacheMap, Ref] { const instance = new Map(); - let heights = new Map(); + const heights = new Map(); const updatedMark = ref(Symbol('update')); watch(mergedData, () => { - heights = new Map(); updatedMark.value = Symbol('update'); }); let heightUpdateId = 0;