From 413516117388328bd39020a76a1fbf312e24132b Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Sun, 8 Aug 2021 15:03:52 +0800 Subject: [PATCH] fix: progress trailColor not work #4483 close #4483 --- components/progress/line.tsx | 20 +++++++++++++++++--- v2-doc | 2 +- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/components/progress/line.tsx b/components/progress/line.tsx index 06afa9685..1ffdbaae5 100644 --- a/components/progress/line.tsx +++ b/components/progress/line.tsx @@ -51,8 +51,16 @@ export const handleGradient = strokeColor => { }; const Line = (_, { attrs, slots }) => { - const { prefixCls, percent, successPercent, strokeWidth, size, strokeColor, strokeLinecap } = - attrs; + const { + prefixCls, + percent, + successPercent, + strokeWidth, + size, + strokeColor, + strokeLinecap, + trailColor, + } = attrs; let backgroundProps; if (strokeColor && typeof strokeColor !== 'string') { backgroundProps = handleGradient(strokeColor); @@ -61,6 +69,12 @@ const Line = (_, { attrs, slots }) => { background: strokeColor, }; } + + const trailStyle = trailColor + ? { + style: { backgroundColor: trailColor }, + } + : undefined; const percentStyle = { width: `${validProgress(percent)}%`, height: `${strokeWidth || (size === 'small' ? 6 : 8)}px`, @@ -80,7 +94,7 @@ const Line = (_, { attrs, slots }) => { return (
-
+
{successSegment}
diff --git a/v2-doc b/v2-doc index 1882ee4e3..157cce105 160000 --- a/v2-doc +++ b/v2-doc @@ -1 +1 @@ -Subproject commit 1882ee4e30b707551a08561f090e72a3f261f6cf +Subproject commit 157cce105e1f0a369658dfb29cc802ebc09d0d93