垂直展示一系列的时间流信息。
在 Taro 文件中引入组件
import { AtTimeline } from 'taro-ui-vue3'
组件依赖的样式文件(仅按需引用时需要)
@import "taro-ui-vue3/dist/style/components/timeline.scss";
<AtTimeline
:items="[
{ title: '刷牙洗脸' },
{ title: '吃早餐' },
{ title: '上班' },
{ title: '睡觉' }
]"
>
</AtTimeline>
<AtTimeline
:items="[
{ title: '刷牙洗脸' },
{ title: '吃早餐', color: 'green' },
{ title: '上班', color: 'red' },
{ title: '睡觉', color: 'yellow' }
]"
>
</AtTimeline>
<AtTimeline
:items="[
{ title: '刷牙洗脸', icon: 'check-circle' },
{ title: '吃早餐', icon: 'clock' },
{ title: '上班', icon: 'clock' },
{ title: '睡觉', icon: 'clock' }
]"
>
</AtTimeline>
<AtTimeline
pending
:items="[
{ title: '刷牙洗脸' },
{ title: '吃早餐' },
{ title: '上班' },
{ title: '睡觉' }
]"
>
</AtTimeline>
<AtTimeline
pending
:items="[
{ title: '刷牙洗脸', content: ['大概8:00'], icon: 'check-circle' },
{ title: '吃早餐', content: ['牛奶+面包', '餐后记得吃药'], icon: 'clock' },
{ title: '上班', content: ['查看邮件', '写PPT', '发送PPT给领导'], icon: 'clock' },
{ title: '睡觉', content: ['不超过23:00'], icon: 'clock' }
]"
>
</AtTimeline>
参数 | 说明 | 类型 | 可选值 | 默认值 |
---|---|---|---|---|
pending | 最后一项是否为未完成态 | Boolean |
- | false |
items | 需展示的内容。数组对象请参考 Item 字段详情 |
Array<Item> |
- | [] |
参数 | 说明 | 类型 | 可选值 | 默认值 |
---|---|---|---|---|
title | 标题 | String |
必填 | - |
content | 子项内容 | String[] |
- | [] |
icon | 自定义 icon | String |
参考icon 组件 |
- |
color | icon 颜色 | String |
`green | red |