rename pending api

This commit is contained in:
zhujun24 2015-09-07 15:26:42 +08:00
parent f3bbf778f8
commit 29638d3d3b
3 changed files with 9 additions and 10 deletions

View File

@ -8,10 +8,10 @@
````jsx
let Timeline = antd.Timeline;
let container = document.getElementById('components-timeline-demo-continue');
let container = document.getElementById('components-timeline-demo-pending');
React.render(
<Timeline continue={true}>
<Timeline pending={true}>
<Timeline.Item>创建服务现场 2015-09-01</Timeline.Item>
<Timeline.Item>初步排除网络异常 2015-09-01</Timeline.Item>
<Timeline.Item>技术测试异常 2015-09-01</Timeline.Item>

View File

@ -8,13 +8,12 @@ let Timeline = React.createClass({
},
render() {
let children = this.props.children;
let continuee = this.props.continue;
return (
<ul className={this.props.prefixCls}>
{React.Children.map(children, function (ele, idx) {
let np = {
timelineLast: idx === children.length - 1,
continuee: continuee
pending: this.props.pending
};
return React.cloneElement(ele, np);
}, this)}
@ -28,18 +27,18 @@ Timeline.Item = React.createClass({
return {
prefixCls: 'ant-timeline',
color: 'blue',
continuee: false
pending: false
};
},
render() {
let props = this.props;
let prefixCls = props.prefixCls;
let color = props.color;
let continuee = props.continuee;
let pending = props.pending;
let timelineLast = props.timelineLast;
let endCls = continuee && timelineLast ? prefixCls + '-item-last' : '';
let last = continuee && timelineLast ? <div className={prefixCls + '-item-head ' + prefixCls + '-item-head-end'}></div> : null;
let lastTailShow = (timelineLast && !continuee) ? 'none' : 'block';
let endCls = pending && timelineLast ? prefixCls + '-item-last' : '';
let last = pending && timelineLast ? <div className={prefixCls + '-item-head ' + prefixCls + '-item-head-end'}></div> : null;
let lastTailShow = (timelineLast && !pending) ? 'none' : 'block';
return (
<li className={prefixCls + '-item ' + endCls}>

View File

@ -30,7 +30,7 @@
| 参数 | 说明 | 类型 | 可选值 |默认值 |
|-----------|------------------------------------------|------------|-------|--------|
| continue | 指定最后一个幽灵节点。 | boolean | 无 | false |
| pending | 指定最后一个幽灵节点。 | boolean | 无 | false |
### Timeline.Item