gs-shop / vue-slick-carousel

🚥Vue Slick Carousel with True SSR Written for ⚡Faster Luxstay
https://gs-shop.github.io/vue-slick-carousel/
Other
810 stars 185 forks source link

How to setup in Nuxt 3? #253

Open iamdagy opened 2 years ago

iamdagy commented 2 years ago

Hi, is there a way to use cue-slick-carousel in Nuxt 3? I've been trying for a while without success.

The error I'm getting is:

[nitro] [dev] [unhandledRejection] TypeError: Invalid value used as weak map key

my current setup is:

in plugins/vueSlickCarousel.js

import {defineNuxtPlugin} from "#app";
import VueSlickCarousel from "vue-slick-carousel";
import 'vue-slick-carousel/dist/vue-slick-carousel-theme.css'
import 'vue-slick-carousel/dist/vue-slick-carousel.css'

export default defineNuxtPlugin(nuxtApp => {
    // Doing something with nuxtApp
    nuxtApp.vueApp.use(VueSlickCarousel)
}) ```

# in Index.vue
iamdagy commented 2 years ago

Also if import it directly in a vue component, I get another error: [nuxt] [request error] Cannot read properties of undefined (reading 'prevArrow')

Javierieh commented 2 years ago

Looks like only Vue 2 is supported, this wont work with nuxt 3 as nuxt 3 uses vue 3