diff --git a/CHANGELOG.md b/CHANGELOG.md index 40fe22d..f82307f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,6 @@ All notable changes to this project will be documented in this file. ### Other changes - Demo page now has an option to test `auto-adjust-text-size` prop. -- Minor refactoring. ## [1.2.0] diff --git a/src/components/Donut.vue b/src/components/Donut.vue index bf26ccf..9e8358e 100644 --- a/src/components/Donut.vue +++ b/src/components/Donut.vue @@ -210,7 +210,7 @@ export default { } }, methods: { - async recalcFontSize() { + recalcFontSize() { if (!this.autoAdjustTextSize) { this.fontSize = '1em'; return; @@ -219,14 +219,15 @@ export default { const scaleDownBy = 0.08; let widthInPx = this.size; - await this.$nextTick(); - if (this.unit !== 'px') { - /* istanbul ignore else */ - if (this.donutEl) widthInPx = this.donutEl.clientWidth; - else widthInPx = null; - } + this.$nextTick(() => { + if (this.unit !== 'px') { + /* istanbul ignore else */ + if (this.donutEl) widthInPx = this.donutEl.clientWidth; + else widthInPx = null; + } - this.fontSize = widthInPx ? `${(widthInPx * scaleDownBy).toFixed(2)}px` : '1em'; + this.fontSize = widthInPx ? `${(widthInPx * scaleDownBy).toFixed(2)}px` : '1em'; + }); }, emitSectionEvent(sectionEventName, ...args) { this.$emit(sectionEventName, ...args);