Skip to content
This repository has been archived by the owner on Jan 18, 2022. It is now read-only.

Invisible pagination (virtual list, collection-repeat) #6

Open
simplesmiler opened this issue Jan 20, 2016 · 5 comments
Open

Invisible pagination (virtual list, collection-repeat) #6

simplesmiler opened this issue Jan 20, 2016 · 5 comments

Comments

@simplesmiler
Copy link
Member

A directive that is like v-for, but keeps only would-be-seen items in the DOM to improve performance.

One way to achieve it is to wrap items into a container, set container to position: relative;, set items to position: absolute; and calculate item positions. This is how collection-repeat works.

Another way is to replace offscreen elements with empty placeholders of appropriate height. This is how infinity works.

References:

@simplesmiler
Copy link
Member Author

Possible solution: https://github.com/paulpflug/vue-clusterize

@paulpflug
Copy link

first working version released 😄

there are probably some bugs since I have no unit tests yet, though.

@simplesmiler
Copy link
Member Author

There is also vue-list-view by @CatchLabs, that uses the same approach that ionic collection-repeat does: position: relative on the container, position: absolute on the items and reuse elements instead of destroying/creating them.

@simplesmiler
Copy link
Member Author

There is also react-virtualized, which looks great.

@simplesmiler
Copy link
Member Author

With 2.0 knocking on the door, the only way to implement this is a higher order component.

Reference: vuejs/vue#3319 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants