Browse Source

dynamic demo

pull/26/head
夏奈 10 years ago
parent
commit
e59a6b2430
  1. 38
      components/progress/demo/circle-dynamic.md
  2. 2
      components/progress/demo/dynamic.md
  3. 2
      components/progress/index.jsx

38
components/progress/demo/circle-dynamic.md

@ -0,0 +1,38 @@
# 动态展示
- order: 4
会动的进度条才是好进度条。
---
````jsx
var ProgressCircle = antd.Progress.Circle;
var MyProgress = React.createClass({
getInitialState() {
return {
percent: 0
};
},
componentDidMount: function() {
var self = this;
setInterval(function() {
if (self.state.percent < 100) {
self.state.percent += 2;
}
self.setState({
percent: self.state.percent
});
}, 100);
},
render() {
return <ProgressCircle percent={this.state.percent} />;
}
});
React.render(
<MyProgress />
, document.getElementById('components-progress-demo-circle-dynamic'));
````

2
components/progress/demo/dynamic.md

@ -27,7 +27,7 @@ var MyProgress = React.createClass({
}, 100);
},
render() {
return <Progress percent={this.state.percent} width="300" strokeWidth="3" />;
return <Progress percent={this.state.percent} />;
}
});

2
components/progress/index.jsx

@ -103,7 +103,7 @@ var Circle = React.createClass({
<i className='anticon anticon-exclamation'></i>
</span>
);
}else if(this.props.status === 'suucess'){
}else if(this.props.status === 'success'){
progressInfo = (
<span style={textStyle} className='ant-progress-circle-text'>
<i className="anticon anticon-check"></i>

Loading…
Cancel
Save