Skip to content

Data ​

To use the data values, add a reference to the carousel element and then get the values from the data property.

Example:

html
<Carousel ref="myCarousel"> ... </Carousel>
js
import { ref } from 'vue';
const myCarousel = ref(null);

// Data can be accessed under data property
if (myCarousel.currentSlide === 10) {
  // Do your magic here
}
....

Available Exposed data ​

DataDescription
currentSlidecurrent slide index
activeSlidecurrent slide index even while dragging
isSlidingif the slider is dragging
isVerticalif the slider is vertical
isNativeif the carousel runs in native CSS mode (nativeCss and browser support)
navAn object of navigation methods
configthe current carousel configuration
maxSlidemaximum slide index
minSlideminimum slide index
slideSizesingle slide width or height
slidesCountslides total count
slidesan array of Slides component
viewportthe viewport element
visibleRangean object with {min, max} properties min being the lowest visible slide index and max the highest
allSlidesFittrue when every slide (plus the leading edgeSpacing) fits in the viewport without wrapAround; always false with wrapAround, with no slides, with slideEffect: 'fade' and more than one slide, and in 'auto' mode before the viewport is measured
isLockedtrue while disableWhenSlidesFit is on and allSlidesFit holds; Navigation and Pagination render nothing

Released under the MIT License.