We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c5f2038 commit 6d7c4c7Copy full SHA for 6d7c4c7
src/icon/icon.ts
@@ -41,8 +41,14 @@ export default class Icon extends SuperComponent {
41
42
this.setData({ isImage }, async () => {
43
if (isImage) {
44
- const { height } = await getRect(this, `.${classPrefix}`);
45
- const iconSize = sizeValue || addUnit(height);
+ let iconSize = sizeValue;
+ if (!iconSize) {
46
+ await getRect(this, `.${classPrefix}`)
47
+ .then((res) => {
48
+ iconSize = addUnit(res?.height);
49
+ })
50
+ .catch(() => {});
51
+ }
52
53
iconStyle.width = iconSize;
54
iconStyle.height = iconSize;
0 commit comments