File tree Expand file tree Collapse file tree 2 files changed +2
-10
lines changed
components/vc-virtual-list Expand file tree Collapse file tree 2 files changed +2
-10
lines changed Original file line number Diff line number Diff line change 11import type { FunctionalComponent , PropType } from 'vue' ;
22import { cloneVNode } from 'vue' ;
3+ import { flattenChildren } from '../_util/props-util' ;
34
45export interface ItemProps {
56 setRef : ( element : HTMLElement ) => void ;
67}
78
89const Item : FunctionalComponent < ItemProps > = ( { setRef } , { slots } ) => {
9- const children = slots . default ?.( ) ;
10+ const children = flattenChildren ( slots . default ?.( ) ) ;
1011
1112 return children && children . length
1213 ? cloneVNode ( children [ 0 ] , {
Original file line number Diff line number Diff line change @@ -224,15 +224,6 @@ const List = defineComponent({
224224 if ( ! useVirtual . value || ! inVirtual . value ) {
225225 return ;
226226 }
227- if ( ! inVirtual . value ) {
228- Object . assign ( calRes , {
229- scrollHeight : offsetHeight . value ,
230- start : 0 ,
231- end : mergedData . value . length - 1 ,
232- offset : undefined ,
233- } ) ;
234- return ;
235- }
236227
237228 let itemTop = 0 ;
238229 let startIndex : number | undefined ;
You can’t perform that action at this time.
0 commit comments