mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 20:19:34 +01:00
feat(Carousel): new component (#927)
Co-authored-by: Michał Hanusek <m.hanusek@myfreak.pl> Co-authored-by: Inesh Bose <dev@inesh.xyz> Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<script setup lang="ts">
|
||||
const items = [
|
||||
'https://picsum.photos/600/800?random=1',
|
||||
'https://picsum.photos/600/800?random=2',
|
||||
'https://picsum.photos/600/800?random=3',
|
||||
'https://picsum.photos/600/800?random=4',
|
||||
'https://picsum.photos/600/800?random=5',
|
||||
'https://picsum.photos/600/800?random=6'
|
||||
]
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UCarousel
|
||||
:items="items"
|
||||
:ui="{
|
||||
item: 'basis-full',
|
||||
container: 'rounded-lg',
|
||||
indicators: {
|
||||
wrapper: 'relative bottom-0 mt-4'
|
||||
}
|
||||
}"
|
||||
indicators
|
||||
class="w-64 mx-auto"
|
||||
>
|
||||
<template #default="{ item }">
|
||||
<img :src="item" class="w-full">
|
||||
</template>
|
||||
|
||||
<template #indicator="{ onClick, index, active }">
|
||||
<UButton :label="index" :variant="active ? 'solid' : 'outline'" size="2xs" class="rounded-full min-w-6 justify-center" @click="onClick(index)" />
|
||||
</template>
|
||||
</UCarousel>
|
||||
</template>
|
||||
Reference in New Issue
Block a user