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

116
Visualizações
Handle a click event on Splide component

I'm using Vue-splide with the latest version. I want to handle the "click" event, so I wrote

<Splide
  @splide:click="test"
  :options="options">

function test(e) {
  console.log(e);
}

In the console I have a weird Proxy { <target>: {…}, <handler>: {…} } appearing. What I would do is doing something with the property data-img of the slide clicked:

  <SplideSlide
    v-for="(photo, i) in projet.fichiers.filter((x) => x.type.includes('image'))"
    :key="`photosplide-${i}`"
    :data-img="``${photo.url}">

I initially put a @click="test" on the SplideSlide but the test launched randomly: sometimes it did, sometimes it didn't, I don't know why. I suppose it's cleaner to handle the event with the native event handling from Splide.

How could I handle the data-img attribute in my test function?

Here is the page of Vue-Splide integration: https://splidejs.com/integration/vue-splide/ And documentation on the click event I'd like to handle: https://splidejs.com/guides/events/#click

Thanks in advance

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