Commit 61cd2bf47a4a0363d07dffbe056f1a0880388da6
Committed by
GitHub
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 | 71 | methods: { |
| 72 | 72 | setScale () { |
| 73 | 73 | this.isSlotShow = !this.src && !this.icon; |
| 74 | - if (this.$slots.default) { | |
| 74 | + if (this.$refs.children) { | |
| 75 | 75 | const childrenWidth = this.$refs.children.offsetWidth; |
| 76 | 76 | const avatarWidth = this.$el.getBoundingClientRect().width; |
| 77 | 77 | // add 4px gap for each side to get better performance |
| ... | ... | @@ -90,4 +90,4 @@ |
| 90 | 90 | this.setScale(); |
| 91 | 91 | } |
| 92 | 92 | }; |
| 93 | -</script> | |
| 94 | 93 | \ No newline at end of file |
| 94 | +</script> | ... | ... |