Browse Source
* docs: add animated number demo for Statistic * style: update demo * add back countdownValueType * type: fix demo typepull/40033/head
afc163
2 years ago
committed by
GitHub
13 changed files with 153 additions and 15 deletions
@ -0,0 +1,7 @@ |
|||
## zh-CN |
|||
|
|||
给数值添加动画进入效果,需要配合 [react-countup](https://www.npmjs.com/package/react-countup)。 |
|||
|
|||
## en-US |
|||
|
|||
Animated number with [react-countup](https://www.npmjs.com/package/react-countup). |
@ -0,0 +1,18 @@ |
|||
import React from 'react'; |
|||
import { Col, Row, Statistic } from 'antd'; |
|||
import CountUp from 'react-countup'; |
|||
|
|||
const formatter = (value: number) => <CountUp end={value} separator="," />; |
|||
|
|||
const App: React.FC = () => ( |
|||
<Row gutter={16}> |
|||
<Col span={12}> |
|||
<Statistic title="Active Users" value={112893} formatter={formatter} /> |
|||
</Col> |
|||
<Col span={12}> |
|||
<Statistic title="Account Balance (CNY)" value={112893} precision={2} formatter={formatter} /> |
|||
</Col> |
|||
</Row> |
|||
); |
|||
|
|||
export default App; |
Loading…
Reference in new issue