carousel.d.ts 1.5 KB

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