Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a continuous v-slide-group with Vuetify?

Has anyone managed to create a continuous v-slide-group with Vuetify? I've created this v-slide-group with custom arrows and all, but now i have to make it continuous - when the last item is reached (by clicking the green arrow, or swiping) it has to start over. I've saw that this functionality is implemented in the v-carousel component (along with the cycle prop), but is there a way to make it with v-slide-group?

enter image description here

like image 273
Y.Futekov Avatar asked May 29 '20 07:05

Y.Futekov


1 Answers

I have a "working solution" right now, i'll be grateful if someone can expand on it, improve it or provide better one: I've v-model-ed the entire slide-group to a 0, and then when the user clicks the next arrow, it increments, previous arrow decrements. It takes 4 clicks to reach the end of the slide-group, so when this.slideGroup == 4, the next click sets it to 0 and restarts it.

slideGroup: 0,
nextSlide() {
  this.slideGroup++;
  this.slideGroup == 4 ? (this.slideGroup = 0) : "";
},
previousSlide() {
  this.slideGroup--;
}
like image 151
Y.Futekov Avatar answered Oct 10 '22 08:10

Y.Futekov