1.0.3 • Published 3 years ago
@projectfive/v-imagecarousel v1.0.3
Image carousel
Installation
npm install @projectfive/v-imagecarousel
Props
- items: (object[]) - list of items. For usage with images with the default slot, include a
src
key.alt
andtitle
keys are supported by default as well.
Slots
- item - default = image, but every element can be provided. Slotprops:
{ item }
- provided object. - next - default =
>
- contents of next arrow button - prev - default =
<
- contents of prev arrow button
Example
<ImageCarousel
:items="[{ src: 'img1.jpg', title: '1' }, { src: 'img2.jpg', title: '2' }]"
class="ratio-16by9"
>
<template v-slot:item="{ item }"}>
<div>
<img :src="item.src" />
{{ item.title }}
</div>
</template>
<template v-slot:next>
<icon>chevron-right</icon>
</template>
<template v-slot:prev>
<icon>chevron-left</icon>
</template>
</ImageCarousel>