mirror of
https://github.com/MrXujiang/h5-Dooring.git
synced 2026-01-18 11:28:12 +00:00
fix image
This commit is contained in:
parent
f0fbca990d
commit
565dbbf0b4
@ -3,17 +3,45 @@ import { IImageConfig } from './schema';
|
|||||||
const Image = memo((props: IImageConfig) => {
|
const Image = memo((props: IImageConfig) => {
|
||||||
const { imgUrl, round = 0 } = props;
|
const { imgUrl, round = 0 } = props;
|
||||||
return (
|
return (
|
||||||
<div
|
<>
|
||||||
style={{
|
{props.isTpl && (
|
||||||
borderRadius: round,
|
<div
|
||||||
width: '100%',
|
style={{
|
||||||
textAlign: 'center',
|
borderRadius: round,
|
||||||
overflow: 'hidden',
|
width: '100%',
|
||||||
position: 'absolute',
|
textAlign: 'center',
|
||||||
}}
|
overflow: 'hidden',
|
||||||
>
|
}}
|
||||||
<img src={imgUrl && imgUrl[0].url} alt="" style={{ width: '100%' }} />
|
>
|
||||||
</div>
|
<img src={imgUrl && imgUrl[0].url} alt="" style={{ width: '100%' }} />
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{!props.isTpl && (
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
overflow: 'hidden',
|
||||||
|
position: 'absolute',
|
||||||
|
width: `${props.baseWidth}%`,
|
||||||
|
height: `${props.baseHeight}%`,
|
||||||
|
borderRadius: props.baseRadius,
|
||||||
|
transform: `translate(${props.baseLeft}px,${props.baseTop}px)
|
||||||
|
scale(${props.baseScale / 100})
|
||||||
|
rotate(${props.baseRotate}deg)`,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
borderRadius: round,
|
||||||
|
width: '100%',
|
||||||
|
textAlign: 'center',
|
||||||
|
overflow: 'hidden',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<img src={imgUrl && imgUrl[0].url} alt="" style={{ width: '100%' }} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user