diff --git a/src/icon/icon.ts b/src/icon/icon.ts index 71087981f..03ac52fde 100644 --- a/src/icon/icon.ts +++ b/src/icon/icon.ts @@ -34,7 +34,7 @@ export default class Icon extends SuperComponent { const { name, color, size } = this.properties; const isImage = name.indexOf('/') !== -1; const sizeValue = addUnit(size); - const sizeStyle = isImage ? { width: sizeValue, height: sizeValue } : {}; + const sizeStyle = isImage && sizeValue ? { width: sizeValue, height: sizeValue } : {}; const colorStyle = color ? { color: color } : {}; const fontStyle = size ? { 'font-size': sizeValue } : {}; this.setData({