Explorar el Código

type(preview): fix type definition

修复Preview组件的事件参数类型定义
无木 hace 3 años
padre
commit
bdf0be81b0
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      src/components/Preview/src/typing.ts

+ 2 - 2
src/components/Preview/src/typing.ts

@@ -6,8 +6,8 @@ export interface Options {
   defaultWidth?: number;
   maskClosable?: boolean;
   rememberState?: boolean;
-  onImgLoad?: (img: HTMLImageElement) => void;
-  onImgError?: (img: HTMLImageElement) => void;
+  onImgLoad?: ({ index: number, url: string, dom: HTMLImageElement }) => void;
+  onImgError?: ({ index: number, url: string, dom: HTMLImageElement }) => void;
 }
 
 export interface Props {