diff --git a/src/components/avatar/avatar.vue b/src/components/avatar/avatar.vue index 38db80db..97d0d23d 100644 --- a/src/components/avatar/avatar.vue +++ b/src/components/avatar/avatar.vue @@ -71,7 +71,7 @@ methods: { setScale () { this.isSlotShow = !this.src && !this.icon; - if (this.$slots.default) { + if (this.$refs.children) { const childrenWidth = this.$refs.children.offsetWidth; const avatarWidth = this.$el.getBoundingClientRect().width; // add 4px gap for each side to get better performance @@ -90,4 +90,4 @@ this.setScale(); } }; - \ No newline at end of file +