carousel.d.ts 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import { ElementUIComponent } from './component'
  2. export type CarouselIndicatorTrigger = 'hover' | 'click'
  3. export type CarouselIndicatorPosition = 'outside' | 'none'
  4. export type CarouselArrowVisibility = 'always' | 'hover' | 'never'
  5. export type CarouselType = 'card'
  6. /** Loop a series of images or texts in a limited space */
  7. export declare class ElCarousel extends ElementUIComponent {
  8. /** Height of the carousel */
  9. height: number
  10. /** Index of the initially active slide (starting from 0) */
  11. initialIndex: number
  12. /** How indicators are triggered */
  13. trigger: CarouselIndicatorTrigger
  14. /** Whether automatically loop the slides */
  15. autoplay: boolean
  16. /** Interval of the auto loop, in milliseconds */
  17. interval: number
  18. /** Position of the indicators */
  19. indicatorPosition: CarouselIndicatorPosition
  20. /** When arrows are shown */
  21. arrow: CarouselArrowVisibility
  22. /** Type of the Carousel */
  23. type: CarouselType
  24. /**
  25. * Manually switch slide by index
  26. *
  27. * @param index Index of the slide to be switched to (starting from 0)
  28. */
  29. setActiveItem (index: number)
  30. /**
  31. * Manually switch slide by carousel item's name
  32. *
  33. * @param name The name of the corresponding `el-carousel-item`
  34. */
  35. setActiveItem (name: string)
  36. /** Switch to the previous slide */
  37. prev ()
  38. /** Switch to the next slide */
  39. next ()
  40. }