SSENSE / vue-carousel

A flexible, responsive, touch-friendly carousel for Vue.js
https://ssense.github.io/vue-carousel/
MIT License
1.72k stars 504 forks source link

Custom forward/next-slide button? #513

Closed ckhatton closed 4 years ago

ckhatton commented 4 years ago

I have created a standalone button on the slide. How does one trigger a slide change forward?

Currently I have created a method, but it breaks the order of the slides:

const first = this.slides.shift()
this.slides = this.slides.concat(first)

:octocat:

lazehang commented 4 years ago

Reference the carousel and call its handleNavigation method.

for eg:

next() {
 this.$refs.carousel.handleNavigation()
},

prev() {
 this.$refs.carousel.handleNavigation('backward')
}

note: your carousel component should have ref attribute set to 'carousel' for this example

ckhatton commented 4 years ago

You legend!! ⭐️ Thank you

bitmoji