mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
* style: use prettier * style: just prettier format, no code changes * style: eslint fix object-shorthand, prefer-const * style: fix no-void * style: no-console
52 lines
1.1 KiB
TypeScript
52 lines
1.1 KiB
TypeScript
import { Ref, ToRefs, UnwrapRef } from 'vue'
|
|
|
|
export interface ICarouselItemProps {
|
|
name: string
|
|
label: string | number
|
|
key: string
|
|
}
|
|
|
|
export interface ICarouselItemData {
|
|
hover: boolean
|
|
translate: number
|
|
scale: number
|
|
active: boolean
|
|
ready: boolean
|
|
inStage: boolean
|
|
animating: boolean
|
|
}
|
|
|
|
export interface ICarouselProps {
|
|
initialIndex: number
|
|
height: string
|
|
trigger: string
|
|
autoplay: boolean
|
|
interval: number
|
|
indicatorPosition: string
|
|
indicator: boolean
|
|
arrow: string
|
|
type: string
|
|
loop: boolean
|
|
direction: string
|
|
pauseOnHover: boolean
|
|
}
|
|
|
|
export type UnionCarouselItemData = ICarouselItemProps &
|
|
ToRefs<ICarouselItemData>
|
|
|
|
export interface CarouselItem extends UnionCarouselItemData {
|
|
uid: number
|
|
translateItem: (index: number, activeIndex: number, oldIndex: number) => void
|
|
}
|
|
|
|
export interface InjectCarouselScope {
|
|
root: Ref<HTMLElement>
|
|
direction: string
|
|
type: string
|
|
items: Ref<UnwrapRef<CarouselItem[]>>
|
|
loop: boolean
|
|
addItem: (item: CarouselItem) => void
|
|
removeItem: (uid: number) => void
|
|
setActiveItem: (index: number) => void
|
|
}
|