Commit 61cd2bf47a4a0363d07dffbe056f1a0880388da6

Authored by Aresn
Committed by GitHub
2 parents d7847330 81b328c6

Merge pull request #1900 from lepture/patch-2

Patch fix on Avatar component
Showing 1 changed file with 2 additions and 2 deletions   Show diff stats
src/components/avatar/avatar.vue
@@ -71,7 +71,7 @@ @@ -71,7 +71,7 @@
71 methods: { 71 methods: {
72 setScale () { 72 setScale () {
73 this.isSlotShow = !this.src && !this.icon; 73 this.isSlotShow = !this.src && !this.icon;
74 - if (this.$slots.default) { 74 + if (this.$refs.children) {
75 const childrenWidth = this.$refs.children.offsetWidth; 75 const childrenWidth = this.$refs.children.offsetWidth;
76 const avatarWidth = this.$el.getBoundingClientRect().width; 76 const avatarWidth = this.$el.getBoundingClientRect().width;
77 // add 4px gap for each side to get better performance 77 // add 4px gap for each side to get better performance
@@ -90,4 +90,4 @@ @@ -90,4 +90,4 @@
90 this.setScale(); 90 this.setScale();
91 } 91 }
92 }; 92 };
93 -</script>  
94 \ No newline at end of file 93 \ No newline at end of file
  94 +</script>