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

520
Visualizações
How to dynamically update Swiper in response to new Slide Array?

I want to retrieve data dynamically and insert it as a slide in my slider. I am using Swiper to do this. However, I run into problems because Swiper does not update as the number of slides in the array increases. Only when I reinitialize Swiper after the new slides are available does Swiper find the new array. I have found the observer parameter to reinitialize Swiper when the children are updated. However, I can not set this to active, i.e. observer:true is not possible.

How do I activate the observer Parameter. I have tried the following approach?

        <Swiper
          slidesPerView={1.2}
          spaceBetween={10}
          loop={false}
          centeredSlides={true}
          observer={true}
          observeParents={true}
          pagination={{
            clickable: true,
          }}
          onSlideChange={
            (swiper) =>
              handleIndexChange(swiper.activeIndex)
          }
          onSwiper={(swiper) => console.log(swiper)}
        >
          {ShowItems}
        </Swiper>
about 4 years ago · Juan Pablo Isaza
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