Skip to content

Instantly share code, notes, and snippets.

@zackproser
Created November 17, 2019 23:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zackproser/bacc7b1c29899b54fc0b304bfed493a1 to your computer and use it in GitHub Desktop.
Save zackproser/bacc7b1c29899b54fc0b304bfed493a1 to your computer and use it in GitHub Desktop.
<template>
<b-carousel id="carousel1"
style="color: #000;"
:interval="6000"
v-model="slide"
@sliding-start="onSlideStart"
@sliding-end="onSlideEnd"
>
<testimonial-card
v-for="testimonial in testimonials"
:key="testimonial.title"
:name="testimonial.name"
:title="testimonial.title"
:quote="testimonial.quote"
:imgSrc="testimonial.imgSrc"
:imgAlt="`${testimonial.name} testimonial`"
>
</testimonial-card>
</b-carousel>
</template>
<script>
import testimonials from '../data/testimonials.json'
import TestimonialCard from '~/components/TestimonialCard.vue'
export default {
name: 'testimonials-carousel',
components: {
TestimonialCard
},
data () {
return {
slide: 0,
sliding: null,
testimonials
}
},
methods: {
onSlideStart (slide) {
this.sliding = true
},
onSlideEnd (slide) {
this.sliding = false
}
}
}
</script>
<style>
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment