Files
timi-web/docs/components/passtime-label.md
T
2026-09-21 15:32:12 +08:00

24 lines
622 B
Markdown

# PassTimeLabel 时间标签
把时间戳显示为「多久以前」,点击可切换为完整日期时间。
## 基础用法
:::preview 基础用法 || 点击标签在相对时间与完整时间之间切换
demo-preview=../demos/passtime-label/basic.vue
:::
## 何时使用
动态列表、评论、消息流里的时间展示。用户往往更关心「多久之前」,需要精确时间时点一下即可。
## 交互与可访问性
标签带 `role="button"` 与 `tabindex="0"`,支持键盘回车与空格触发切换,因此可以安全地放在列表项里。
## API
<api-table name="PassTimeLabel" />