cpreston321 / nuxt-swiper

Swiper.js for Nuxt
https://www.npmjs.com/package/nuxt-swiper
MIT License
236 stars 12 forks source link

Breakpoints not working #141

Open larsvdd opened 1 week ago

larsvdd commented 1 week ago

I updated to swiper 2.0.0 but after the migration steps my breakpoints aren't working anymore.

const swiper = useSwiper(mySlider, {
    autoplay: {
        delay: 8000,
        disableOnInteraction: true,
    },
    breakpoints: {
        768: {
            slidesPerView: 6,
        },
    },
    loop: true,
    slidesPerView: 3,
});

The swiper does render, but it is always 3 slides.

P.S. I would like to see a fix for SSR, I want the content to be indexed by search engines. So no more: <ClientOnly>

cpreston321 commented 1 week ago

Hey @larsvdd I will definitely take a look if you could provide a reproduction in StackBlitz that would be great!

For the sever side.. I will definitely take a look the only problem is swiper web components is purely client based and will only register on the client side which causes issues with SSR. I will try to think of some approaches to solve this in the mean time.

Thanks, CP