From d28e535d0370e230945705cae36dfa1d95132361 Mon Sep 17 00:00:00 2001 From: John Date: Fri, 15 Jan 2021 17:25:16 +0800 Subject: [PATCH] fix(Circle): the gradient color is incorrect (#7910) fix #7897 --- src/circle/index.js | 9 ++------- src/circle/test/__snapshots__/demo.spec.js.snap | 8 ++++---- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/circle/index.js b/src/circle/index.js index 2f1764fa6..e2b9f64d6 100644 --- a/src/circle/index.js +++ b/src/circle/index.js @@ -84,7 +84,7 @@ export default createComponent({ const offset = (PERIMETER * this.value) / 100; return { - stroke: `${this.color}`, + stroke: `${this.gradient ? `url(#${this.uid})` : this.color}`, strokeWidth: `${+this.strokeWidth + 1}px`, strokeLinecap: this.strokeLinecap, strokeDasharray: `${offset}px ${PERIMETER}px`, @@ -158,12 +158,7 @@ export default createComponent({ {this.LinearGradient} - + {this.slots() || (this.text &&
{this.text}
)} diff --git a/src/circle/test/__snapshots__/demo.spec.js.snap b/src/circle/test/__snapshots__/demo.spec.js.snap index 58fc6e132..1aea0cd47 100644 --- a/src/circle/test/__snapshots__/demo.spec.js.snap +++ b/src/circle/test/__snapshots__/demo.spec.js.snap @@ -19,7 +19,7 @@ exports[`renders demo correctly 1`] = `
- +
颜色定制
@@ -31,19 +31,19 @@ exports[`renders demo correctly 1`] = ` - +
渐变色
- +
逆时针
- +
大小定制