Is there a way to have a manual control like buttons?
Then, I want to jump on page 3 for example?
Thanks.
@gomezmark you should define ref attribute on the carousel
<carousel ref="carousel"></carousel>
and use goToPage function
this.$refs.carousel.goToPage(3)
Also you can get previous, next, current page or perPage
const perPage = this.$refs.carousel.perPage
const current = this.$refs.carousel.currentPage
const previous = this.$refs.carousel.getPreviousPage()
const next = this.$refs.carousel.getNextPage()
Yeah @dvasyliev is right! There is actually an example of adding "go to page x" buttons on the vue-play instance when you spin up the dev server :~)
@dvasyliev
Thank you for you answer.
but the .getNextPage() is not working on my end.
It returns the next page index.
But what I did is like this.
slideControl (action) {
let page = 0
if (action === 'next') {
page = this.$refs.carousel.getNextPage()
} else {
page = this.$refs.carousel.getPreviousPage()
}
this.$refs.carousel.goToPage(page)
}
Could the carousel's methods be added to the api documentation?
Getting this error this.$refs.carousel.getPreviousPage is not a function
Most helpful comment
Could the carousel's methods be added to the api documentation?