vue-virtual-collection icon indicating copy to clipboard operation
vue-virtual-collection copied to clipboard

Dose it support vue3?

Open Justinnng opened this issue 2 years ago • 1 comments

Justinnng avatar Jul 27 '21 09:07 Justinnng

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.

edenchazard avatar Oct 10 '22 09:10 edenchazard