UNPKG

957 BTypeScriptView Raw
1import { VNode } from 'vue'
2import { ElementUIComponent } from './component'
3
4export type ObjectFit = 'fill' | 'contain' | 'cover' | 'none' | 'scale-down'
5
6export interface ImageSlots {
7 /** Placeholder content when image hasn't loaded yet */
8 placeholder: VNode[]
9
10 /** Error content when error occurs to image load */
11 error: VNode[]
12
13 [key: string]: VNode[]
14}
15
16/** Image Component */
17export declare class ElImage extends ElementUIComponent {
18 /** Image source */
19 src: string
20
21 /** Indicate how the image should be resized to fit its container, same as native 'object-fit' */
22 fit: ObjectFit
23
24 /** Whether to use lazy load */
25 lazy: boolean
26
27 /** Scroll container that to add scroll listener when using lazy load */
28 scrollContainer: string | HTMLElement
29
30 /** Native 'alt' attribute */
31 alt: string
32
33 /** Native 'referrerPolicy' attribute */
34 referrerPolicy: string
35
36 $slots: ImageSlots
37
38 previewSrcList: string[]
39
40 zIndex: number
41}