简体中文
fs-timeline
约 360 字大约 1 分钟
2026-06-25
简介
Timeline 时间线组件用于垂直展示的时间流信息,常用于展示操作记录、流程进度等场景。
使用方法
局部引入,在需要引入的页面或组件的index.json中配置。
"usingComponents": {
"fs-timeline": "ava-ui/fxui/fs-timeline/index"
}代码演示
基础用法
API
Properties
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---|---|---|---|---|
| type | 时间线类型 | String | business/approval/simple | business |
| items | 时间线数据 | Array | - | [] |
| timePosition | 时间显示位置 | String | top/title | top |
| showTime | 是否显示时间 | Boolean | - | true |
| showTitle | 是否显示标题 | Boolean | - | true |
| showDescription | 是否显示描述 | Boolean | - | true |
| showContent | 是否显示内容区 | Boolean | - | true |
| lineColor | 时间线颜色 | String | - | #E0E0E0 |
| dotColor | 节点颜色 | String | - | #52C41A |
| extStyle | 外部样式 | String | - | '' |
Items 数据结构
| 参数 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| time | 时间文本 | String | - |
| title | 标题 | String | - |
| description | 描述 | String | - |
| actions | 操作按钮数组 | Array<{ text: string, type?: string }> | - |
| content | 内容区文本 | String | - |
| dotStatus | 节点状态(normal/processing/success/reject) | String | - |
actions 数组说明
- text:按钮文本,必填
- type:按钮类型,可选值 primary(主按钮)、danger(危险)、default(次按钮/默认)
Events
| 名称 | 参数 | 描述 |
|---|---|---|
| actiontap | 操作按钮点击事件,actionIndex为按钮索引,action为按钮对象 | |
| itemtap | 时间线项点击事件 |
