image.d.ts 957 B

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