Skip to content

Commit

Permalink
fix(upload): 上传组件图片展示样式优化
Browse files Browse the repository at this point in the history
  • Loading branch information
huangchen1031 committed Dec 20, 2024
1 parent 02d14d0 commit 91e75ed
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/upload/themes/ImageCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,13 @@ const ImageCard = (props: ImageCardUploadProps) => {

const renderMainContent = (file: UploadFile, index: number) => (
<div className={`${classPrefix}-upload__card-content ${classPrefix}-upload__card-box`}>
<Image className={`${classPrefix}-upload__card-image`} src={file.url || file.raw} error="" loading="" />
<Image
className={`${classPrefix}-upload__card-image`}
fit="contain"
src={file.url || file.raw}
error=""
loading=""
/>
<div className={`${classPrefix}-upload__card-mask`}>
<span className={`${classPrefix}-upload__card-mask-item`} onClick={(e) => e.stopPropagation()}>
<ImageViewer
Expand Down
8 changes: 7 additions & 1 deletion src/upload/themes/MultipleFlowList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,13 @@ const ImageFlowList = (props: ImageFlowListProps) => {
</div>
)}
{(['waiting', 'success'].includes(file.status) || (!file.status && file.url)) && (
<Image className={`${uploadPrefix}__card-image`} src={file.url || file.raw} error="" loading="" />
<Image
className={`${uploadPrefix}__card-image`}
fit="contain"
src={file.url || file.raw}
error=""
loading=""
/>
)}
<div className={`${uploadPrefix}__card-mask`}>
{(file.url || file.raw) && !['progress', 'fail'].includes(file.status) && (
Expand Down

0 comments on commit 91e75ed

Please sign in to comment.