2019-03-24 17:05:24 +08:00
|
|
|
---
|
|
|
|
order: 11
|
|
|
|
title:
|
|
|
|
zh-CN: 自定义进度条渐变色
|
|
|
|
en-US: Custom line gradient
|
|
|
|
---
|
|
|
|
|
|
|
|
## zh-CN
|
|
|
|
|
|
|
|
`linear-gradient` 的封装。推荐只传两种颜色。
|
|
|
|
|
|
|
|
## en-US
|
|
|
|
|
|
|
|
A package of `linear-gradient`. It is recommended to only pass two colors.
|
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
```tsx
|
2019-03-24 17:05:24 +08:00
|
|
|
import { Progress } from 'antd';
|
2022-05-21 22:14:15 +08:00
|
|
|
import React from 'react';
|
2019-03-24 17:05:24 +08:00
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
const App: React.FC = () => (
|
2020-05-25 16:27:02 +08:00
|
|
|
<>
|
2019-03-24 17:05:24 +08:00
|
|
|
<Progress
|
|
|
|
strokeColor={{
|
|
|
|
'0%': '#108ee9',
|
|
|
|
'100%': '#87d068',
|
|
|
|
}}
|
|
|
|
percent={99.9}
|
|
|
|
/>
|
|
|
|
<Progress
|
|
|
|
strokeColor={{
|
|
|
|
from: '#108ee9',
|
|
|
|
to: '#87d068',
|
|
|
|
}}
|
|
|
|
percent={99.9}
|
|
|
|
status="active"
|
|
|
|
/>
|
2019-06-26 18:13:45 +08:00
|
|
|
<Progress
|
|
|
|
type="circle"
|
|
|
|
strokeColor={{
|
|
|
|
'0%': '#108ee9',
|
|
|
|
'100%': '#87d068',
|
|
|
|
}}
|
|
|
|
percent={90}
|
|
|
|
/>
|
|
|
|
<Progress
|
|
|
|
type="circle"
|
|
|
|
strokeColor={{
|
|
|
|
'0%': '#108ee9',
|
|
|
|
'100%': '#87d068',
|
|
|
|
}}
|
|
|
|
percent={100}
|
|
|
|
/>
|
2020-05-25 16:27:02 +08:00
|
|
|
</>
|
2019-03-24 17:05:24 +08:00
|
|
|
);
|
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
export default App;
|
2019-05-07 14:57:32 +08:00
|
|
|
```
|