Patch fix on Avatar component
There are chances that when there is this.$slots.default there is no this.$refs.children.
This commit is contained in:
parent
71ef48658c
commit
81b328c6f1
1 changed files with 2 additions and 2 deletions
|
@ -71,7 +71,7 @@
|
||||||
methods: {
|
methods: {
|
||||||
setScale () {
|
setScale () {
|
||||||
this.isSlotShow = !this.src && !this.icon;
|
this.isSlotShow = !this.src && !this.icon;
|
||||||
if (this.$slots.default) {
|
if (this.$refs.children) {
|
||||||
const childrenWidth = this.$refs.children.offsetWidth;
|
const childrenWidth = this.$refs.children.offsetWidth;
|
||||||
const avatarWidth = this.$el.getBoundingClientRect().width;
|
const avatarWidth = this.$el.getBoundingClientRect().width;
|
||||||
// add 4px gap for each side to get better performance
|
// add 4px gap for each side to get better performance
|
||||||
|
@ -90,4 +90,4 @@
|
||||||
this.setScale();
|
this.setScale();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Add table
Reference in a new issue