Skip to content

Commit

Permalink
perf(icon): set the size style (#2787)
Browse files Browse the repository at this point in the history
  • Loading branch information
betavs authored May 21, 2024
1 parent 8d595cf commit 18640ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/icon/icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit 18640ab

Please sign in to comment.