antonreshetov / vue-glide

A slider and carousel as vue component on top of the Glide.js
https://antonreshetov.github.io/vue-glide/
MIT License
269 stars 39 forks source link

Listening on the index of current active slide #6

Closed sarahxoxo closed 5 years ago

sarahxoxo commented 5 years ago

Hi, I've read the documents, and still don't know how to use events. Could you give an example about how to listen on the index of current active slide?

antonreshetov commented 5 years ago

Hi @sarahxoxo, The fact that vue-glide provides only those events that are in the glide.js that are prefixed with glide:. Glide.js not provide index of active slide.

Currently, vue-glide has a custom event glide: slide-click which returns the index of the slide on which the click was made. This part is a further development in which I plan to add slide switching by click.

sarahxoxo commented 5 years ago

Hi @antonreshetov , Got it. Thanks for your reply.

madhurikulkarni commented 4 years ago

@antonreshetov

This part is a further development in which I plan to add slide switching by click.

Is there a way to do this currently with the slider. ?

madhurikulkarni commented 4 years ago

My solution if it helps someone, using the slide-click Slider Initialisation: <vue-glide ref="slider" @glide:slide-click="moveSlide"> Methods: moveSlide(index) { this.$refs.slider.glide.go(=${index}) }

Enigama commented 4 years ago

@antonreshetov

This part is a further development in which I plan to add slide switching by click.

Is there a way to do this currently with the slider. ?

<vue-glide ref="slider" @glide:swipe-end="setDataProducts"> Methods: setDataProducts(){ this.$refs.slider.glide.index }