2016-03-31 09:40:55 +08:00
|
|
|
---
|
|
|
|
order: 6
|
2016-07-26 15:42:04 +08:00
|
|
|
title:
|
|
|
|
zh-CN: 自定义文字格式
|
|
|
|
en-US: Custom text format
|
2016-03-31 09:40:55 +08:00
|
|
|
---
|
2016-01-20 19:50:45 +08:00
|
|
|
|
2016-07-26 15:42:04 +08:00
|
|
|
## zh-CN
|
|
|
|
|
2016-01-20 19:50:45 +08:00
|
|
|
`format` 属性指定格式。
|
|
|
|
|
2016-07-26 15:42:04 +08:00
|
|
|
## en-US
|
|
|
|
|
2018-07-29 00:58:10 +08:00
|
|
|
You can set a custom text by setting the `format` prop.
|
2016-07-26 15:42:04 +08:00
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
```tsx
|
2016-01-20 20:20:24 +08:00
|
|
|
import { Progress } from 'antd';
|
2022-05-21 22:14:15 +08:00
|
|
|
import React from 'react';
|
2016-01-20 19:50:45 +08:00
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
const App: React.FC = () => (
|
2020-05-25 16:27:02 +08:00
|
|
|
<>
|
2016-09-30 15:21:03 +08:00
|
|
|
<Progress type="circle" percent={75} format={percent => `${percent} Days`} />
|
2022-10-31 10:23:26 +08:00
|
|
|
<Progress type="circle" percent={100} format={() => 'Done'} style={{ marginLeft: 8 }} />
|
2022-04-03 23:27:45 +08:00
|
|
|
</>
|
2018-11-28 15:00:03 +08:00
|
|
|
);
|
2022-05-19 09:46:26 +08:00
|
|
|
|
|
|
|
export default App;
|
2019-05-07 14:57:32 +08:00
|
|
|
```
|