From 110077e7adb7cf8096f1c3c0111f22b95b44fe2d Mon Sep 17 00:00:00 2001 From: zzk <974758671@qq.com> Date: Wed, 15 Nov 2023 22:29:11 +0800 Subject: [PATCH] test(statistic): update test --- src/statistic/Statistic.tsx | 11 +++++------ src/statistic/_example/combination.tsx | 6 +++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/statistic/Statistic.tsx b/src/statistic/Statistic.tsx index 91ff608959..b16be72f13 100644 --- a/src/statistic/Statistic.tsx +++ b/src/statistic/Statistic.tsx @@ -118,9 +118,8 @@ const Statistic = forwardRef((props, ref) => { }, []); useEffect(() => { - if (animationStart && animation && !tween.current) { - start(); - } + animationStart && animation && !tween.current && start(); + return () => { if (tween.current) { tween.current.stop(); @@ -135,9 +134,9 @@ const Statistic = forwardRef((props, ref) => { tween.current = null; } setInnerValue(value); - if (animationStart && animation) { - start(); - } + + animationStart && animation && start(); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [value]); diff --git a/src/statistic/_example/combination.tsx b/src/statistic/_example/combination.tsx index 5d69d5910e..8201e69bd9 100644 --- a/src/statistic/_example/combination.tsx +++ b/src/statistic/_example/combination.tsx @@ -5,9 +5,9 @@ import { IconFont } from 'tdesign-icons-react'; const CombinationStatistic = () => { const iconStyle = { fontSize: '32px', - color: '#0052d9', - background: '#f2f3ffff', - borderRadius: '6px', + color: 'var(--td-brand-color)', + background: 'var(--td-brand-color-light)', + borderRadius: 'var(--td-radius-medium)', padding: '12px', }; const separator = ;