轮播展示一组内容,适合头图与宣传位。




<script setup>
import { DanCarousel, DanCarouselItem } from '@dandan-ui/ui'
</script>
<template>
<DanCarousel height="240px" arrow="always">
<DanCarouselItem>
<img src="/images/wall-sunset.png" alt="城墙日落" />
</DanCarouselItem>
<DanCarouselItem>
<img src="/images/city-rainbow.png" alt="城市彩虹" />
</DanCarouselItem>
<DanCarouselItem>
<img src="/images/blackhole.png" alt="黑洞" />
</DanCarouselItem>
<DanCarouselItem>
<img src="/images/starburst.png" alt="星空" />
</DanCarouselItem>
</DanCarousel>
</template>| 属性 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| modelValue / v-model | 当前索引 | number | 0 |
| height | 高度 | string | '220px' |
| autoplay | 自动播放 | boolean | true |
| interval | 间隔毫秒 | number | 3000 |
| loop | 循环 | boolean | true |
| arrow | 箭头显示 | 'always' | 'hover' | 'never' | 'hover' |
| indicator | 指示器 | boolean | true |
update:modelValue / change