Wlada / vue-carousel-3d

Vue Carousel 3D - Beautiful, flexible and touch supported 3D Carousel for Vue.js
MIT License
969 stars 203 forks source link

Previous / Next as Vue components #62

Open tsauvajon opened 6 years ago

tsauvajon commented 6 years ago

I would like to pass a Vue component rather than a string to controlsPrevHtml and controlsNextHtml.

I've not found any way to dynamically render my component to a string in Vue, and that would anyway prevent me from dispatching events.

tsauvajon commented 6 years ago

We've programmatically changed the slides using a ref and goSlide.

methods: {
    prevSlide () {
      if (this.selectedProject === 0) {
        return this.$refs.carousel.goSlide(this.slides.length - 1)
      }
      this.$refs.carousel.goSlide(this.slideIndex - 1)
    },
    nextSlide () {
      this.$refs.carousel.goSlide(this.slideIndex + 1)
    },
    onBeforeSlideChange (index) {
      this.slideIndex= index
    }
  }
tsauvajon commented 6 years ago

It would be easier to simply pass in a Vue component than re implementing the logic of the slide changes (even though it is trivial)