From f34afd2deb21205a609008a218299f27bd8d08ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=98=89=E6=B6=B5?= Date: Fri, 10 May 2019 11:09:39 +0800 Subject: [PATCH] [bugfix] Progress: incorrect width when update pivoit-text --- packages/progress/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/progress/index.js b/packages/progress/index.js index 3f9d2850c..886d8b201 100644 --- a/packages/progress/index.js +++ b/packages/progress/index.js @@ -50,8 +50,10 @@ export default sfc({ methods: { getWidth() { - this.progressWidth = this.$el.offsetWidth; - this.pivotWidth = this.$refs.pivot ? this.$refs.pivot.offsetWidth : 0; + this.$nextTick(() => { + this.progressWidth = this.$el.offsetWidth; + this.pivotWidth = this.$refs.pivot ? this.$refs.pivot.offsetWidth : 0; + }); } },