mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-03 16:39:41 +08:00
6776bb8916
* docs: update demo * chore: add script * test: fix demo test * docs: convert demos * chore: move script * test: remove react-dom import * chore: update deps * docs: update riddle js * test: fix image test * docs: fix riddle demo
57 lines
911 B
Markdown
57 lines
911 B
Markdown
---
|
|
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.
|
|
|
|
```jsx
|
|
import { Progress } from 'antd';
|
|
|
|
const Demo = () => (
|
|
<>
|
|
<Progress
|
|
strokeColor={{
|
|
'0%': '#108ee9',
|
|
'100%': '#87d068',
|
|
}}
|
|
percent={99.9}
|
|
/>
|
|
<Progress
|
|
strokeColor={{
|
|
from: '#108ee9',
|
|
to: '#87d068',
|
|
}}
|
|
percent={99.9}
|
|
status="active"
|
|
/>
|
|
<Progress
|
|
type="circle"
|
|
strokeColor={{
|
|
'0%': '#108ee9',
|
|
'100%': '#87d068',
|
|
}}
|
|
percent={90}
|
|
/>
|
|
<Progress
|
|
type="circle"
|
|
strokeColor={{
|
|
'0%': '#108ee9',
|
|
'100%': '#87d068',
|
|
}}
|
|
percent={100}
|
|
/>
|
|
</>
|
|
);
|
|
|
|
export default () => <Demo />;
|
|
```
|