Skip to content

Commit

Permalink
remove async await usage to prevent inflated bundle size
Browse files Browse the repository at this point in the history
  • Loading branch information
dumptyd committed Mar 22, 2020
1 parent b035ae5 commit f0ddebf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Expand Up @@ -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]

Expand Down
17 changes: 9 additions & 8 deletions src/components/Donut.vue
Expand Up @@ -210,7 +210,7 @@ export default {
}
},
methods: {
async recalcFontSize() {
recalcFontSize() {
if (!this.autoAdjustTextSize) {
this.fontSize = '1em';
return;
Expand All @@ -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);
Expand Down

0 comments on commit f0ddebf

Please sign in to comment.