sard-uniapp
Version:
sard-uniapp 是一套基于 Uniapp + Vue3 框架开发的兼容多端的 UI 组件库
57 lines (56 loc) • 1.68 kB
TypeScript
import { type StyleValue } from 'vue';
import { type DefaultProps } from '../config';
export type ImageMode = 'scaleToFill' | 'aspectFit' | 'aspectFill' | 'widthFix' | 'heightFix' | 'top' | 'bottom' | 'center' | 'left' | 'right' | 'top left' | 'top right' | 'bottom left' | 'bottom right';
export interface ImageProps {
rootStyle?: StyleValue;
rootClass?: string;
src?: string;
mode?: ImageMode;
lazyLoad?: boolean;
webp?: boolean;
showMenuByLongpress?: boolean;
width?: string;
height?: string;
shape?: 'circle' | 'square';
radius?: string;
loadingIcon?: string;
errorIcon?: string;
iconFamily?: string;
showLoading?: boolean;
showError?: boolean;
background?: string;
fade?: boolean;
customLoad?: (callback: (event: any) => void) => any;
}
export declare const defaultImageProps: () => DefaultProps<ImageProps>;
export interface ImageSlots {
loading?(props: Record<string, never>): any;
error?(props: Record<string, never>): any;
}
export interface ImageEmits {
(e: 'click', event: any): void;
(e: 'load', event: any): void;
(e: 'error', event: any): void;
}
export interface ImageExpose {
}
export declare const FIX_MODES: {
widthFix: boolean;
heightFix: boolean;
};
export declare const IMAGE_MODES: {
aspectFit: string[];
aspectFill: string[];
scaleToFill: string[];
widthFix: (string | undefined)[];
heightFix: (string | undefined)[];
top: string[];
bottom: string[];
left: string[];
right: string[];
center: string[];
'top left': string[];
'top right': string[];
'bottom left': string[];
'bottom right': string[];
};