2016-03-31 09:40:55 +08:00
---
order: 2
2017-12-27 17:54:12 +08:00
title:
2018-04-20 11:23:37 +08:00
zh-CN: 最后一个及排序
en-US: Last node and Reversing
2016-03-31 09:40:55 +08:00
---
2015-09-01 21:15:31 +08:00
2016-07-04 10:49:04 +08:00
## zh-CN
2018-04-20 11:23:37 +08:00
当任务状态正在发生,还在记录过程中,可用幽灵节点来表示当前的时间节点,当 pending 为真值时展示幽灵节点,如果 pending 是 React 元素可用于定制该节点内容,同时 pendingDot 将可以用于定制其轴点。reverse 属性用于控制节点排序,为 false 时按正序排列,为 true 时按倒序排列。
2017-12-27 17:54:12 +08:00
2016-07-04 10:49:04 +08:00
## en-US
2019-05-07 14:57:32 +08:00
When the timeline is incomplete and ongoing, put a ghost node at last. Set `pending` as truthy value to enable displaying pending item. You can customize the pending content by passing a React Element. Meanwhile, `pendingDot={a React Element}` is used to customize the dot of the pending item. `reverse={true}` is used for reversing nodes.
2016-07-04 10:49:04 +08:00
2019-05-07 14:57:32 +08:00
```jsx
2018-04-20 11:23:37 +08:00
import { Timeline, Button } from 'antd';
class PendingTimeLine extends React.Component {
state = {
reverse: false,
2019-05-07 14:57:32 +08:00
};
2018-04-20 11:23:37 +08:00
handleClick = () => {
this.setState({ reverse: !this.state.reverse });
2019-05-07 14:57:32 +08:00
};
2018-04-20 11:23:37 +08:00
render() {
return (
< div >
< Timeline pending = "Recording..." reverse = {this.state.reverse} >
< Timeline.Item > Create a services site 2015-09-01< / Timeline.Item >
< Timeline.Item > Solve initial network problems 2015-09-01< / Timeline.Item >
< Timeline.Item > Technical testing 2015-09-01< / Timeline.Item >
< / Timeline >
2019-05-07 14:57:32 +08:00
< Button type = "primary" style = {{ marginTop: 16 } } onClick = {this.handleClick} >
Toggle Reverse
< / Button >
2018-04-20 11:23:37 +08:00
< / div >
);
}
}
2022-04-03 23:27:45 +08:00
export default () => < PendingTimeLine / > ;
2019-05-07 14:57:32 +08:00
```