Skip to content

TCarousel / 走马灯

Carousel cycles through images or content items with slide/fade animations. Supports auto-play, indicators (dots/bars/thumbs), controls, and pause-on-hover. / 走马灯以滑动或淡入淡出动画循环展示图片或内容,支持自动播放、多种指示器样式、控制按钮和悬停暂停。

Props / 属性

PropType / 类型Default / 默认值Description / 说明
itemsCarouselItem[]Carousel items
intervalnumberAuto-play interval (ms), 0 to disable
animation'slide' | 'fade''slide'Animation type
indicatorsbooleantrueShow indicators
indicatorStyle'default' | 'dot' | 'thumb''default'Indicator style
controlsbooleantrueShow prev/next controls
wrapbooleantrueLoop playback
pauseOnHoverbooleanfalsePause on hover

Basic Usage / 基础用法

vue
<script setup lang="ts">
import { TCarousel } from '@gulcc/tabler-vue'

const slides = [
  { image: '/slide1.jpg', title: 'Slide 1' },
  { image: '/slide2.jpg', title: 'Slide 2' },
]
</script>

<template>
  <TCarousel :items="slides" />
</template>

Tips / 避坑指南

  • interval=0 disables auto-play — user must manually navigate
  • wrap=false stops at the first/last item (no loop)
  • indicatorStyle="thumb" shows thumbnail previews as indicators
  • Items can have html field for fully custom content