diff --git a/components/timeline/Timeline.tsx b/components/timeline/Timeline.tsx index d065d1c667..5605586b44 100644 --- a/components/timeline/Timeline.tsx +++ b/components/timeline/Timeline.tsx @@ -8,6 +8,7 @@ export interface TimelineProps { className?: string; /** 指定最后一个幽灵节点是否存在或内容 */ pending?: React.ReactNode; + pendingDot?: React.ReactNode; style?: React.CSSProperties; } @@ -18,7 +19,7 @@ export default class Timeline extends React.Component { }; render() { - const { prefixCls, children, pending, className, ...restProps } = this.props; + const { prefixCls, children, pending, pendingDot, className, ...restProps } = this.props; const pendingNode = typeof pending === 'boolean' ? null : pending; const classString = classNames(prefixCls, { [`${prefixCls}-pending`]: !!pending, @@ -33,7 +34,7 @@ export default class Timeline extends React.Component { const pendingItem = (!!pending) ? ( } + dot={pendingDot || } > {pendingNode} diff --git a/components/timeline/demo/pending.md b/components/timeline/demo/pending.md index 058b433698..ce30a3315d 100644 --- a/components/timeline/demo/pending.md +++ b/components/timeline/demo/pending.md @@ -7,11 +7,11 @@ title: ## zh-CN -当任务状态正在发生,还在记录过程中,可用幽灵节点来表示当前的时间节点。(用于时间正序排列) +当任务状态正在发生,还在记录过程中,可用幽灵节点来表示当前的时间节点(用于时间正序排列)。当 pending 值为 false ,可用定制元件替换默认时间图点。 ## en-US -When the timeline is incomplete and ongoing, put a ghost node at last. set `pending={true}` or `pending={a React Element}`. Used in ascend chronological order. +When the timeline is incomplete and ongoing, put a ghost node at last. set `pending={true}` or `pending={a React Element}`. Used in ascend chronological order. When `pending` is not false, set `pendingDot={a React Element}` to replace the default pending dot. ````jsx import { Timeline } from 'antd'; diff --git a/components/timeline/index.en-US.md b/components/timeline/index.en-US.md index 48abf84445..88410fdb01 100644 --- a/components/timeline/index.en-US.md +++ b/components/timeline/index.en-US.md @@ -29,6 +29,7 @@ Timeline | Property | Description | Type | Default | | -------- | ----------- | ---- | ------- | | pending | Set the last ghost node's existence or its content | boolean\|string\|ReactNode | `false` | +| pendingDot | Set the dot of the last ghost node when pending is true | \|string\|ReactNode | `` | ### Timeline.Item diff --git a/components/timeline/index.zh-CN.md b/components/timeline/index.zh-CN.md index 3b5f20f0ca..a97f348201 100644 --- a/components/timeline/index.zh-CN.md +++ b/components/timeline/index.zh-CN.md @@ -30,6 +30,7 @@ title: Timeline | 参数 | 说明 | 类型 | 默认值 | | --- | --- | --- | --- | | pending | 指定最后一个幽灵节点是否存在或内容 | boolean\|string\|ReactNode | false | +| pendingDot | 当最后一个幽灵节点存在時,指定其时间图点 | \|string\|ReactNode | `` | ### Timeline.Item