From 8942eb56fa81f31fc0c04c16c1c6c4f7374392ae Mon Sep 17 00:00:00 2001 From: neverland Date: Thu, 5 Jul 2018 19:24:00 +0800 Subject: [PATCH] [bugfix] Progress: text empty (#1411) --- packages/progress/index.vue | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/packages/progress/index.vue b/packages/progress/index.vue index 2b6a2a2e2..70a3587b7 100644 --- a/packages/progress/index.vue +++ b/packages/progress/index.vue @@ -1,7 +1,7 @@ @@ -14,6 +14,7 @@ export default create({ props: { inactive: Boolean, + pivotText: String, pivotColor: String, percentage: { type: Number, @@ -24,12 +25,6 @@ export default create({ type: Boolean, default: true }, - pivotText: { - type: String, - default() { - return this.percentage + '%'; - } - }, color: { type: String, default: '#38f' @@ -48,6 +43,12 @@ export default create({ }, computed: { + text() { + return this.isDef(this.pivotText) + ? this.pivotText + : this.percentage + '%'; + }, + currentColor() { return this.inactive ? '#cacaca' : this.color; },