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

module SwiperGrid isn't working. #117

Open
selenechin opened this issue Feb 3, 2024 · 2 comments
Open

module SwiperGrid isn't working. #117

selenechin opened this issue Feb 3, 2024 · 2 comments

Comments

@selenechin
Copy link

selenechin commented Feb 3, 2024

Hello!
I'm new using nuxt-swiper. I need the grid style but for some reason it's not working.
My nuxt version it's 3.3.1.

Here's my code:

<template>
    <Swiper
        class="swiper"
        :grid="{
            rows: 2,
            }"
        :spaceBetween="30"
        :slidesPerView="4"
        :autoplay="{
            delay: 5000,
            disableOnInteraction: false,
        }"
        :pagination="{
            clickable: true,
        }"
        :loop="true"
        :modules="[Pagination, Navigation, Grid]"
    >
    
 <SwiperSlide  >
    <img src="https://www.nme.com/wp-content/uploads/2022/08/seventeen-wonwoo-iu-knees-cover-youtube-pledis-entertainment.jpg" alt="">
    </SwiperSlide>
    <SwiperSlide  >
    <img src="https://asset-2.tstatic.net/tribunnews/foto/bank/images/fakta-menarik-wonwoo-seventeen-pernah-lupa-lirik-saat-tampil.jpg" alt="">
    </SwiperSlide>
    <SwiperSlide  >
    <img src="https://static.promediateknologi.id/crop/0x0:0x0/750x500/webp/photo/2023/01/09/2375568015.png" alt="">
    </SwiperSlide>
    <SwiperSlide  >
    <img src="https://www.rappler.com/tachyon/2022/04/seventeen-wonwoo.jpg" alt="">
    </SwiperSlide>
    <SwiperSlide  >
    <img src="https://images.gmanews.tv/webpics/2022/04/SEVENTEEN_member_Wonwoo_2022_04_06_13_35_11.png" alt="">
    </SwiperSlide>
    <SwiperSlide  >
    <img src="https://static.promediateknologi.id/crop/152x62:880x486/750x500/webp/photo/2023/01/08/1218840254.jpg" alt="">
    </SwiperSlide>
  </template>

 <script setup lang="ts">
import { Navigation, Autoplay, Pagination, Grid} from 'swiper';
import 'swiper/css/grid';

</script> 

and it looks like this:
imagen

Can someone, please guide me? 🙏🏻.

@cpreston321
Copy link
Owner

Can you make a StackBlitz reproduction? 🙏🏻

@NevodD
Copy link

NevodD commented Jun 27, 2024

Hi. Add it height through CSS styles for .swiper-wrapper and .swiper-slide
https://open-code.tech/en/post-943/

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

3 participants