From 25cba38b459de877b497c584d3a650fe89c693bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E7=81=8F?= Date: Wed, 4 Sep 2019 15:53:32 +0800 Subject: [PATCH] Progress prop strokeColor support Array type, and support the linear-gradient color --- examples/routers/progress.vue | 12 +++++++++++- src/components/progress/progress.vue | 8 ++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/examples/routers/progress.vue b/examples/routers/progress.vue index 49a65f0a..1e8a63dc 100644 --- a/examples/routers/progress.vue +++ b/examples/routers/progress.vue @@ -15,10 +15,20 @@ + + + + + diff --git a/src/components/progress/progress.vue b/src/components/progress/progress.vue index 3e41464d..c26c8046 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;