Skip to content

Commit 58913c5

Browse files
committed
[FIX]#148
1 parent 832ffe8 commit 58913c5

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/components/avatar/avatar.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,18 @@
114114
}
115115
},
116116
beforeCreate () {
117-
this.slotTemp = this.$slots.default ? this.$slots.default() : null;
117+
this.$nextTick(() => {
118+
this.slotTemp = this.$slots.default ? this.$slots.default() : null;
119+
});
118120
},
119121
mounted () {
120122
this.setScale();
121123
},
122124
updated () {
123-
const slot = this.$slots.default ? this.$slots.default() : null;
124-
if (slot && slot !== this.slotTemp) this.setScale();
125+
this.$nextTick(() => {
126+
const slot = this.$slots.default ? this.$slots.default() : null;
127+
if (slot && slot !== this.slotTemp) this.setScale();
128+
});
125129
}
126130
};
127131
</script>

0 commit comments

Comments
 (0)