Skip to content

FxTimeline 时间线 ​

可视化地呈现时间流信息。不依赖任何 UI 框架,颜色走 @fx/styles 的 --color-* token。

轴线与默认节点为 --color-border-light(灰),仅当传 type 时节点变为语义色。

基础用法 ​

Timeline 可拆分为多个活动节点,时间戳是其区别于其他组件的重要特性。

模式 mode ​

使用 mode 控制时间线与内容的相对位置。

自定义节点 ​

节点的尺寸、颜色、图标均可自定义。

自定义时间戳 ​

内容较高时,可将时间戳置于内容上方(placement="top")。

垂直居中 ​

center 让节点垂直居中。

倒序 reverse ​

使用 reverse 控制节点排列顺序。

API ​

FxTimeline Attributes ​

属性说明类型默认值
mode时间线与内容的相对位置'start' | 'end' | 'alternate' | 'alternate-reverse'start
reverse是否倒序渲染booleanfalse

FxTimeline Slots ​

插槽名说明
defaultFxTimelineItem 列表(必填)

FxTimelineItem Attributes ​

属性说明类型默认值
timestamp时间戳文本string''
hideTimestamp是否隐藏时间戳booleanfalse
center节点是否垂直居中booleanfalse
placement时间戳相对内容的位置'top' | 'bottom'bottom
type节点颜色类型(被 color 覆盖)'primary' | 'success' | 'warning' | 'danger' | 'info' | ''''
color自定义节点颜色string''
size节点尺寸'normal' | 'large'normal
icon节点图标。字符串为 IconString 类型(即 FxIcon 图标名,如 ep:edit、ant-design:home、svg:xxx)string—
hollow节点是否空心booleanfalse

FxTimelineItem Slots ​

插槽名说明
default内容主体
dot自定义节点(提供时不再渲染默认圆点节点)