mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-26 18:08:34 +08:00
1e8d3ce40d
* try: init gradient line demo * demo(Progress): update instructions * chore: adjust default color * test: update case and snapshots * docs: update description for strokeColor * docs: update for more in written * test: correct type of Progress * pref: support percent for strokeColor * test: update snapshots * test: update case * pref: sort key for gradients * fix: lgtm problem * refactor: update output of sortGradient to string * chore: make traversal more elegant
42 lines
663 B
Markdown
42 lines
663 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 = () => (
|
|
<div>
|
|
<Progress
|
|
strokeColor={{
|
|
'0%': '#108ee9',
|
|
'100%': '#87d068',
|
|
}}
|
|
percent={99.9}
|
|
status="active"
|
|
/>
|
|
<Progress
|
|
strokeColor={{
|
|
from: '#108ee9',
|
|
to: '#87d068',
|
|
}}
|
|
percent={99.9}
|
|
status="active"
|
|
/>
|
|
</div>
|
|
);
|
|
|
|
ReactDOM.render(<Demo />, mountNode);
|
|
````
|