Carousel (轮播)
横向轮播(KunCarousel + KunCarouselItem):原生滚动吸附 + 触摸滑动,箭头/圆点/自动播放为渐进增强。
基础用法
Basic.vue
多图视图 (slidesPerView)
MultiView.vue
自动播放
Autoplay.vue
属性
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| ariaLabel | string | "轮播" | |
| autoplay | number | 0 | Autoplay interval in ms (0 = off). Pauses on hover/focus, off under reduced-motion. |
| className | string | "" | |
| gap | string | "1rem" | Gap between slides (any CSS length). |
| loop | boolean | true | Seamless infinite loop via slide repositioning (CSS `order`), no cloned DOM. Autoplay glides past the last slide into the first instead of snapping back. Default `true`; auto-disabled when there are too few slides to loop cleanly. |
| showArrows | boolean | true | |
| showIndicators | boolean | true | |
| slidesPerView | number | 1 | Slides visible at once (>1 for thumbnail strips). |