Skip to content

Timeline 时间线

可视化地呈现时间流信息。

何时使用

  • 当有一系列信息需按时间排列时
  • 需要有一条时间轴进行视觉上的串联时

基本用法

Timeline 可拆分成多个按照时间戳排列的活动,时间戳是其区分于其他控件的重要特征。

自定义节点样式

可根据实际场景自定义节点尺寸、颜色,或直接使用图标。

自定义时间戳

当内容在垂直方向上过高时,可将时间戳置于内容之上。

垂直居中

垂直居中样式的 Timeline-Item。

自定义节点

可以通过插槽自定义节点。

API

Timeline Slots

插槽名说明子标签
defaulttimeline 组件的自定义默认内容Timeline-Item

Timeline-Item Props

参数说明类型可选值默认值
timestamp时间戳string''
hide-timestamp是否隐藏时间戳booleanfalse
center是否垂直居中booleanfalse
placement时间戳位置stringtop/bottombottom
type节点类型stringTimelineItemType
color节点颜色string
size节点尺寸stringnormal/largenormal
icon自定义图标string/Component
hollow是否空心点booleanfalse

Timeline-Item Events

事件名说明回调参数

Timeline-Item Slots

插槽名说明
default自定义内容
dot自定义节点

Timeline类型定义

TimelineItemType

ts
export type TimelineItemType = 'primary' | 'success' | 'warning' | 'danger' | 'info' | ''

Released under the MIT License.