Closed pumpknhd closed 1 year ago
The cycle props allows you to do this with the arrows (which are also shown in the example), however, if you don't want to use them you could use watch:
on the model to set the model to the last item if the models value is -1.
I made a codepen for you.
@Mert75 Thanks for your codepen, but notice that the animation is inconsistent between the swipe vs the buttons. At Slide 5, I'd you click the button to go next, it slides appropriately to Slide 1. But when you swipe to go next, the animation is backwards.
Edit: The +/- buttons on top (which uses the model) also doesn't animate correctly. When it goes from 0 to -1, it doesn't animate correctly (compare this to the arrows).
This Issue is being closed due to inactivity.
If you have any questions, please reach out to us in our Discord community.
Environment
Vuetify Version: 2.3.8 Vue Version: 2.6.11 Browsers: Chrome 84.0.4147.125 OS: Windows 10
Steps to reproduce
Expected Behavior
When model reaches 0 and tries to model--, it should loop around to the end.
Actual Behavior
Model is stuck at 0.
Reproduction Link
https://codepen.io/pumpknhd/pen/BaKodyp
Other comments
The other direction works. See reproduction link. When at Slide 5 and you click on the plus icon, it goes to Slide 1. But at Slide 1 and you click on the minus button, it's stuck there.
Manually changing the v-model doesn't work because the transition would be in the wrong direction.