Skip to content

Commit

Permalink
fix: Add the onClick API type declaration of the Image component
Browse files Browse the repository at this point in the history
  • Loading branch information
YyumeiZhang committed Jan 8, 2024
1 parent 3626826 commit 11245f5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/semi-ui/image/_story/image.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export const BasicPreview = () => {
width={200}
alt={`lamp${index + 1}`}
data-test={'data-test'}
onClick={()=>{}}
/>
)})}
</ImagePreview>
Expand Down
1 change: 1 addition & 0 deletions packages/semi-ui/image/image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export default class Image extends BaseComponent<ImageProps, ImageStates> {
preview: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]),
onLoad: PropTypes.func,
onError: PropTypes.func,
onClick: PropTypes.func,
crossOrigin: PropTypes.string,
imageID: PropTypes.number,
}
Expand Down
1 change: 1 addition & 0 deletions packages/semi-ui/image/interface.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export interface ImageProps extends BaseProps{
preview?: boolean | PreviewProps;
onError?: (event: Event) => void;
onLoad?: (event: Event) => void;
onClick?: (event: any) => void;
crossOrigin?: "anonymous"| "use-credentials";
children?: ReactNode;
imageID?: number;
Expand Down

0 comments on commit 11245f5

Please sign in to comment.