Browse Source

fix: progress demo and trailWidth

pull/3251/head
Benjy Cui 8 years ago
parent
commit
06e4eaa7d5
  1. 4
      components/progress/demo/format.md
  2. 3
      components/progress/progress.tsx

4
components/progress/demo/format.md

@ -18,8 +18,8 @@ import { Progress } from 'antd';
ReactDOM.render( ReactDOM.render(
<div> <div>
<Progress type="circle" percent={75} format={percent => `${percent}% Discount`} /> <Progress type="circle" percent={75} format={percent => `${percent} Days`} />
<Progress type="circle" percent={100} format={() => 'Complete'} /> <Progress type="circle" percent={100} format={() => 'Done'} />
</div> </div>
, mountNode); , mountNode);
```` ````

3
components/progress/progress.tsx

@ -92,9 +92,10 @@ export default class Progress extends React.Component<ProgressProps, any> {
height: circleSize, height: circleSize,
fontSize: circleSize * 0.16 + 6, fontSize: circleSize * 0.16 + 6,
}; };
const circleWidth = strokeWidth || 6;
progress = ( progress = (
<div className={`${prefixCls}-inner`} style={circleStyle}> <div className={`${prefixCls}-inner`} style={circleStyle}>
<Circle percent={percent} strokeWidth={strokeWidth || 6} <Circle percent={percent} strokeWidth={circleWidth} trailWidth={circleWidth}
strokeColor={statusColorMap[progressStatus]} trailColor={trailColor} strokeColor={statusColorMap[progressStatus]} trailColor={trailColor}
/> />
{progressInfo} {progressInfo}

Loading…
Cancel
Save