fix: type ref bug in tiny.ring

mgy
Dawn1Ocean 2024-04-06 17:00:51 +08:00
parent 29704a6197
commit 3b52792917
1 changed files with 4 additions and 2 deletions

View File

@ -3,9 +3,11 @@ import { PageContainer, ProCard, StatisticCard } from '@ant-design/pro-component
import { Card, Statistic } from 'antd'; import { Card, Statistic } from 'antd';
import RcResizeObserver from 'rc-resize-observer'; import RcResizeObserver from 'rc-resize-observer';
import { useState } from 'react'; import { useState } from 'react';
import type { TinyRingConfig } from '@ant-design/charts';
const percentRing = (percent: number, frontColor: string): React.JSX.Element => { const percentRing = (percent: number, frontColor: string): React.JSX.Element => {
const config = { const TinyRing = Tiny.Ring;
const config: TinyRingConfig = {
percent: percent / 100, percent: percent / 100,
width: 120, width: 120,
height: 120, height: 120,
@ -25,7 +27,7 @@ const percentRing = (percent: number, frontColor: string): React.JSX.Element =>
], ],
}; };
return <Tiny.Ring {...config} />; return <TinyRing {...config} />;
}; };
interface IndexData { interface IndexData {