gs-shop / vue-slick-carousel

🚥Vue Slick Carousel with True SSR Written for ⚡Faster Luxstay
https://gs-shop.github.io/vue-slick-carousel/
Other
803 stars 186 forks source link

Attribute id to a slide - Goal : make a goTo(id of a slide) #200

Open daishizenSensei opened 3 years ago

daishizenSensei commented 3 years ago

Hello everyone,

Do you know how it is possible to return attributes (like id) of a slide. In order to use goTo(id of a slide). It is usefull to combine a slider with an other component (like markers of a map).

Thanks a lot, Kevin

pheitland commented 3 years ago

Just keep track of the slides you pass into the slider and use their index in the goTo function

const slides = [ 'foo', // goTo(0) 'bar' // goTo(1) ]

daishizenSensei commented 3 years ago

Yes i know but it doesn't work in my case : I have a map with markers, each have a specific id. And a slider, each slide is related to a marker and have same id I would like to click on a marker and make a goTo(id of the marker/slider)