mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 12:09:14 +08:00
rename pending api
This commit is contained in:
parent
f3bbf778f8
commit
29638d3d3b
@ -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>
|
@ -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}>
|
||||
|
@ -30,7 +30,7 @@
|
||||
|
||||
| 参数 | 说明 | 类型 | 可选值 |默认值 |
|
||||
|-----------|------------------------------------------|------------|-------|--------|
|
||||
| continue | 指定最后一个幽灵节点。 | boolean | 无 | false |
|
||||
| pending | 指定最后一个幽灵节点。 | boolean | 无 | false |
|
||||
|
||||
### Timeline.Item
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user