-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[add] Upload: support custom imageSize
- Loading branch information
Showing
5 changed files
with
111 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { getFileSrc } from '@/knife' | ||
import { DeleteOutlined } from '@ant-design/icons' | ||
|
||
import type { IPropsCustomImage } from '../types' | ||
|
||
const Index = (props: IPropsCustomImage) => { | ||
const { file, imageSize, remove } = props | ||
|
||
return ( | ||
<div className='upload_custom_wrap flex relative'> | ||
<div className='icon_delete absolute justify_center align_center transition_normal' onClick={remove}> | ||
<DeleteOutlined className='icon'></DeleteOutlined> | ||
</div> | ||
<img | ||
className='image' | ||
src={getFileSrc(file.response!)} | ||
style={{ borderRadius: 6, objectFit: 'cover', ...imageSize }} | ||
></img> | ||
</div> | ||
) | ||
} | ||
|
||
export default window.$app.memo(Index) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters