Questions about the length
prop
#254
-
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The The
Note that a "virtual scroll" experience is different from an classic "infinite scroll" experience, where you just load more items when reaching to the current end of list, so If you set
We can and it may sill load all the possible items eventually. However, the user experience would be different I'd imagine, especial if the network is not fast enough. You'd have to wait for the next batch of items to be loaded when you reach to the current end of grid. You can "scroll over" the end of grid while loading the next batch.
I didn't experiment with it, but I think this probably will hit the performance more or less as the whole thing is reactive. Changing Performance aside, the length of scrollbar would change dynamically when |
Beta Was this translation helpful? Give feedback.
The
length
is required to calculate the total length of grid, under a viewport, so browsers can render the grid with a proper scrollbar, as if all the items are rendered at the same time.The
length
also helpvue-virtual-scroll-grid
to determine which items are visible hence need to be rendered, given a scrollbar position. For example, given a list of 100 item, when you scroll the list half way through, the component may render the 33th to 66th items.length
doesn't bring any performance benefits. Instead, it's required for a "virtual scroll" experience.