如果父组件是 h1,我需要图像尺寸非常大,并且如果父尺寸的字体为 20px,我需要图像组件对此做出响应,并相对于父组件的字体大小更改其大小。
<span style={fontSize:'10px'}>
<img
style={{ height: 'auto', maxHeight: '100px' }}
alt='image not fount'
src={user.imageUrl}
/>
</span>
<span> {username}</span>