vue-virtual-collection
vue-virtual-collection copied to clipboard
Dose it support vue3?
Hi, I like this virtual scroll grid because it's faster than any of the other implementations for my use case.
For anyone still wondering if this can be used in Vue 3: Yes, it can :)
First you should import the component directly:
import VirtualCollection from "vue-virtual-collection/src/VirtualCollection.vue";
Slots were changed in 3, so use it like this:
<VirtualCollection
:cellSizeAndPositionGetter="cellSizeAndPositionGetter"
:collection="items"
:height="height"
:width="width"
:sectionSize="size">
<template v-slot:cell="{ data }">
<span>{{ data.name }}</span>
</template>
</VirtualCollection>
There are a few deprecated lifecycle hooks used but they should be easy to fix.