Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

158
Visualizações
Swiperjs slides wont slide properly

I am using swiperjs and I am having difficulty making the slides as they wont snap to the next slide and I cant get the active index from them this is my code
where am I going wrong I am using typescript and swiperjs version 6.84 with the ionic framework

import 'swiper/components/navigation/navigation.min.css'
import 'swiper/components/pagination/pagination.min.css'






  const pagination = {
    clickable: true,
  };
 
  return (
    <IonPage>
  

      <Swiper
        pagination={pagination}
        
        onBeforeSlideChangeStart={e => {
          setIndex(e.activeIndex)
        }}>
        <SwiperSlide >
          <item property={property} index={0} save={dispatch} activeIndex={index} />
        </SwiperSlide>
        <SwiperSlide >
            <item 2 property={property} index={1} />
        </SwiperSlide>
        <SwiperSlide >
            <item3 property={property} index={1} />
        </SwiperSlide>
      </Swiper>
      <IonButton
        disabled={true}
        onClick={(e) => {
          e.preventDefault();
        }}
        className={"next"}
        expand={"block"}
      >
        Save
      </IonButton>
    </IonPage>
  );
}
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I forgot to add ionContent so the slides were not reacting in the correct way I also had to add observe

 <IonPage>
  
<IonContent fullscreen>
      <Swiper
        pagination={pagination}
        observeParents={true}
        observer={true}
        onBeforeSlideChangeStart={e => {
          setIndex(e.activeIndex)
        }}>
        <SwiperSlide >
          <item property={property} index={0} save={dispatch} activeIndex={index} />
        </SwiperSlide>
        <SwiperSlide >
            <item 2 property={property} index={1} />
        </SwiperSlide>
        <SwiperSlide >
            <item3 property={property} index={1} />
        </SwiperSlide>
      </Swiper>
      <IonButton
        disabled={true}
        onClick={(e) => {
          e.preventDefault();
        }}
        className={"next"}
        expand={"block"}
      >
        Save
      </IonButton>
</IonContent>
    </IonPage>
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda