mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 20:19:34 +01:00
34 lines
898 B
Vue
34 lines
898 B
Vue
<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="String(index)" :variant="active ? 'solid' : 'outline'" size="2xs" class="rounded-full min-w-6 justify-center" @click="onClick(index)" />
|
|
</template>
|
|
</UCarousel>
|
|
</template>
|