Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dose it support vue3? #38

Open
Justinnng opened this issue Jul 27, 2021 · 1 comment
Open

Dose it support vue3? #38

Justinnng opened this issue Jul 27, 2021 · 1 comment

Comments

@Justinnng
Copy link

No description provided.

@Justinnng Justinnng changed the title Is it support vue3? Dose it support vue3? Jul 27, 2021
@edenchazard
Copy link

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.

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

No branches or pull requests

2 participants