Carousel
Loop a series of images or texts in a limited space.
Basic Usage
Combine el-carousel
with el-carousel-item
, and you'll get a carousel. The prev next button can be displayed when the mouse enters, Click to switch。The indicator is displayed by default, allowing click toggle。
Content Custom
Content of each slide is completely customizable, and you just need to place it inside el-carousel-item
tag.
Carousel API
Carousel Attributes
Name | Description | Type | Default |
---|---|---|---|
auto-play | by default auto play | boolean | true |
duration | timer duration | number | 3000 |
height | carousel height | string | 300px |
Carousel Events
Name | Description | Parameters |
---|---|---|
change | triggers when the active slide switches | index of the new active slide |
Carousel Methods
Name | Description | Parameters |
---|---|---|
setActiveItem | manually switch slide | index of the slide to be switched to, starting from 0 |
prev | switch to the previous slide | - |
next | switch to the next slide | - |