Created
November 17, 2019 23:02
-
-
Save zackproser/bacc7b1c29899b54fc0b304bfed493a1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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