Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

111
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!