diff --git a/src/packages/empty/empty.taro.tsx b/src/packages/empty/empty.taro.tsx index f37cdc107..3d23f5117 100644 --- a/src/packages/empty/empty.taro.tsx +++ b/src/packages/empty/empty.taro.tsx @@ -69,7 +69,7 @@ export const Empty: FunctionComponent< useEffect(() => { setImgStyle(() => { - if (!imageSize) { + if (typeof imageSize !== 'number' && typeof imageSize !== 'string') { return {} } if (typeof imageSize === 'number') { diff --git a/src/packages/empty/empty.tsx b/src/packages/empty/empty.tsx index 6117a8434..662062f81 100644 --- a/src/packages/empty/empty.tsx +++ b/src/packages/empty/empty.tsx @@ -71,7 +71,7 @@ export const Empty: FunctionComponent< useEffect(() => { setImgStyle(() => { - if (!imageSize) { + if (typeof imageSize !== 'number' && typeof imageSize !== 'string') { return {} } if (typeof imageSize === 'number') {