From 730eba8adb71acbff609b014b82405c277eb1545 Mon Sep 17 00:00:00 2001 From: "mo.duan" Date: Fri, 6 Sep 2019 15:19:01 +0800 Subject: [PATCH] =?UTF-8?q?Progress=20prop=20strokeColor=20support=20Array?= =?UTF-8?q?=20type,=20and=20support=20the=20linear-=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/routers/progress.vue | 9 ++++++++- src/components/progress/progress.vue | 8 ++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/examples/routers/progress.vue b/examples/routers/progress.vue index 3bb7b21a..8d335823 100644 --- a/examples/routers/progress.vue +++ b/examples/routers/progress.vue @@ -12,10 +12,17 @@ + + diff --git a/src/components/progress/progress.vue b/src/components/progress/progress.vue index 5587239a..8cdff7fa 100644 --- a/src/components/progress/progress.vue +++ b/src/components/progress/progress.vue @@ -54,7 +54,7 @@ default: false }, strokeColor: { - type: String + type: [String, Array] }, textInside: { type: Boolean, @@ -93,7 +93,11 @@ }; if (this.strokeColor) { - style['background-color'] = this.strokeColor; + if (typeof this.strokeColor === 'string') { + style['background-color'] = this.strokeColor; + } else { + style['background-image'] = `linear-gradient(to right, ${this.strokeColor[0]} 0%, ${this.strokeColor[1]} 100%)`; + } } return style;