diff --git a/components/progress/demo/circle-mini.md b/components/progress/demo/circle-mini.md new file mode 100644 index 0000000000..3aa0678b67 --- /dev/null +++ b/components/progress/demo/circle-mini.md @@ -0,0 +1,27 @@ +# Circle 用法 + +- order: 0 + +Progress Circle用法 + +--- + +````jsx +var Circle = antd.Progress.Circle; + +React.render( +
+ + + +
+ , document.getElementById('components-progress-demo-circle-mini')); +```` + + diff --git a/components/progress/demo/circle.md b/components/progress/demo/circle.md index 5bf88efda7..7ef2562cd4 100644 --- a/components/progress/demo/circle.md +++ b/components/progress/demo/circle.md @@ -11,9 +11,9 @@ var Circle = antd.Progress.Circle; React.render(
- - - + + +
, document.getElementById('components-progress-demo-circle')); ```` diff --git a/components/progress/demo/line-mini.md b/components/progress/demo/line-mini.md new file mode 100644 index 0000000000..eb5ab9eeb9 --- /dev/null +++ b/components/progress/demo/line-mini.md @@ -0,0 +1,19 @@ +# Line 用法 + +- order: 0 + +Progress Line用法 + +--- + +````jsx +var Line = antd.Progress.Line; + +React.render( +
+ + + +
+ , document.getElementById('components-progress-demo-line-mini')); +```` diff --git a/components/progress/demo/line.md b/components/progress/demo/line.md index 181ee4f108..8acf417078 100644 --- a/components/progress/demo/line.md +++ b/components/progress/demo/line.md @@ -11,9 +11,9 @@ var Line = antd.Progress.Line; React.render(
- - - + + +
, document.getElementById('components-progress-demo-line')); ```` diff --git a/components/progress/index.jsx b/components/progress/index.jsx index 88b4319a44..1109a31558 100644 --- a/components/progress/index.jsx +++ b/components/progress/index.jsx @@ -8,9 +8,9 @@ var Line = React.createClass({ getDefaultProps: function () { return { percent: 0, - strokeWidth: 2, + strokeWidth: 4, status: 'normal' // exception - } + }; }, render() { var statusColorMap = { @@ -20,42 +20,42 @@ var Line = React.createClass({ }; if (parseInt(this.props.percent) === 100) { - this.props.status = 'success' + this.props.status = 'success'; } var style = { 'width': this.props.width - } + }; var wrapStyle = { 'font-size': this.props.width / 100 * this.props.strokeWidth - } + }; var textStyle = { 'color': statusColorMap[this.props.status] - } - var progressInfo + }; + var progressInfo; if (this.props.status === 'exception') { progressInfo = ( - ) + ); } else if(this.props.status === 'success'){ progressInfo = ( - ) + ); }else { progressInfo = ( {this.props.percent}% - ) + ); } return (
+ strokeColor={statusColorMap[this.props.status]} trailColor="#e9e9e9" />
{progressInfo}
@@ -67,9 +67,9 @@ var Circle = React.createClass({ getDefaultProps: function () { return { percent: 0, - strokeWidth: 2, + strokeWidth: 4, status: 'normal' // exception - } + }; }, render() { var statusColorMap = { @@ -79,37 +79,37 @@ var Circle = React.createClass({ }; if (parseInt(this.props.percent) === 100) { - this.props.status = 'success' + this.props.status = 'success'; } var style = { 'width': this.props.width, 'height': this.props.width - } + }; var wrapStyle = { 'font-size': this.props.width * 0.3 - } + }; var textStyle = { 'color': statusColorMap[this.props.status] - } - var progressInfo + }; + var progressInfo; if (this.props.status === 'exception') { progressInfo = ( - ) + ); }else { progressInfo = ( {this.props.percent}% - ) + ); } return (
+ strokeColor={statusColorMap[this.props.status]} trailColor="#e9e9e9" /> {progressInfo}
diff --git a/components/progress/index.md b/components/progress/index.md index c60f339749..01198a783f 100644 --- a/components/progress/index.md +++ b/components/progress/index.md @@ -8,15 +8,15 @@ ## 使用 -`` +`` -`` +`` ## 属性参数 | 参数 | 说明 | 类型 | 默认值 | |----------|----------------|----------|--------------| -| perscent | 百分比 | number | 0 | +| percent | 百分比 | number | 0 | | status | 状态,有两个值normal、exception | string | normal | | strokeWidth | 进度条线宽度,单位是进度条画布宽度的百分比 | number | 1 | | width | 必填,进度条画布宽度,单位px。这里没有提供height属性设置,Line型高度就是strokeWidth,Circle型高度等于width | number | null |