🐞 fix(图片): 图片显示降级处理
This commit is contained in:
parent
34abf8fc7f
commit
344d77b7bc
@ -48,10 +48,14 @@ export default memo(({ value, onClick, showStatus = false }: Param) => {
|
||||
setLabAndImgShow(true)
|
||||
}
|
||||
|
||||
const handleImageError = () => {
|
||||
setImgs([])
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<View className={styles.labAndImg_main} onClick={() => onShowLabAndImg()}>
|
||||
{imgs?.length > 0 && <Image mode='aspectFill' src={imgs[0]} className={styles.labAndImg_image}></Image>}
|
||||
{imgs?.length > 0 && <Image mode='aspectFill' src={imgs[0]} className={styles.labAndImg_image} onError={handleImageError}></Image>}
|
||||
{!imgs?.length && rgbStyle && <View className={styles.boxColor} style={{ ...rgbStyle }}></View>}
|
||||
{!imgs?.length && !rgbStyle && <Image mode='aspectFill' src={formatImgUrl('')} className={styles.labAndImg_image}></Image>}
|
||||
</View>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user