mpbarlow / vue-renderless-carousel

Encapsulated carousel functionality in a renderless Vue.js component
MIT License
19 stars 5 forks source link

[Feature request] Function to navigate left and right #1

Open dumptyd opened 4 years ago

dumptyd commented 4 years ago

Honestly, I'm creating this issue mainly to tell you this is the most underrated vue library I've come across. Great documentation and examples and the component works flawlessly. Finding a customizable carousel proved to be a surprisingly hard task. Thanks for making this!


Coming to the feature request, I think it would be useful if the scoped slot exposed a function to navigate left and right with wrapping supported. I'm thinking something on the lines of this so the function can be hooked to previous/next buttons without any extra code.

navigate(by) {
  this.value = (this.value + by) % this.count;
}
mpbarlow commented 3 years ago

Thank you for the kind words! I'm so sorry it's taken me so long to see this, I had notifications disabled for the repo and didn't realise.

I am going to be releasing a compatibility update soon to make sure everything works with both Vue 2 and Vue 3. I'll add this feature as part of that update.

Thanks again!