按时间阅读一组记录。items 中每项提供唯一 key 和 title,description 补充说明。事件排序、时间格式化和业务操作由调用方处理;需要引导用户完成可切换步骤时使用 Steps。
基本用法
默认按 items 顺序展示纵向记录,label 为有序列表提供可访问名称。省略状态时使用中性空心圆环,文字和图片内容均可自然撑开条目。
状态与审批记录
status 支持 neutral、info、success、warning、danger,同时提供状态图形与文字;statusLabel 替换为“审核中”“待修改”等实际文案。传入空字符串可隐藏状态标签,此时标题或说明应表达完整含义。
下面的按钮由页面更新审批数据,Timeline 展示结果。它不会发送请求或把记录当作可点击步骤。
时间位置与密度
time 是已格式化的显示文案;dateTime 可选,填写带时区的 ISO 时间或合法的 HTML 日期值,生成原生 <time datetime>。“刚刚”“待安排”等文案可只传 time,不会自动解析。
timePosition="aside" 在容器达到 32rem 时将时间放到侧列,窄容器自动回到标题上方。timeWidth 设置侧列宽度,最大占容器 30%;density="compact" 收紧记录间距与字阶,内部按钮继续使用自己的尺寸。文字方向继承容器的 dir。
自定义节点与内容
icon 使用已注册图标。indicator 插槽使用 24px 的节点区域,可放 size="xs" 的 Avatar 或同尺寸的装饰节点,让连接线与图形保持间距。交互操作放入 content 插槽,保留正常的按钮焦点与键盘行为。time、title、description 插槽分别定制对应区域,所有条目插槽提供 item 和原数组 index。
逆序、长内容与空数据
reverse 反转展示和读屏顺序,不修改传入数组。连续字符和长说明会换行。空数组显示跟随 Locale Provider 语言的空状态文案,也可通过 empty 插槽组合 EmptyState;不会生成虚构节点。
API
QuireTimeline Props
Slots 内容位置
indicatorDecorative content for the 24px node area, such as an xs Avatar; keep interactive controls in content.
{ /** Original event object. */ item: { /** Unique identity retained when records are inserted or reordered. */ key: string; /** Human-readable event heading. */ title: string; /** Supporting detail, rendered as literal text. */ description?: undefined | string; /** Already formatted time label; the component does not choose a locale or time zone. */ time?: string | undefined; /** Valid HTML datetime value, supplied separately from the display label. */ dateTime?: string | undefined; /** Semantic indicator and default status label; omission renders a neutral ring without a label. */ status?: undefined | "neutral" | "info" | "success" | "warning" | "danger"; /** Override the status text; an empty string intentionally hides it. */ statusLabel?: string | undefined; /** Registered decorative icon name; the indicator slot takes precedence. */ icon?: string | undefined; }; /** Index in the original items array. */ index: number; }timeDisplay label within the native time element when dateTime is provided.
{ /** Original event object. */ item: { /** Unique identity retained when records are inserted or reordered. */ key: string; /** Human-readable event heading. */ title: string; /** Supporting detail, rendered as literal text. */ description?: undefined | string; /** Already formatted time label; the component does not choose a locale or time zone. */ time?: string | undefined; /** Valid HTML datetime value, supplied separately from the display label. */ dateTime?: string | undefined; /** Semantic indicator and default status label; omission renders a neutral ring without a label. */ status?: undefined | "neutral" | "info" | "success" | "warning" | "danger"; /** Override the status text; an empty string intentionally hides it. */ statusLabel?: string | undefined; /** Registered decorative icon name; the indicator slot takes precedence. */ icon?: string | undefined; }; /** Index in the original items array. */ index: number; }titleEvent heading content.
{ /** Original event object. */ item: { /** Unique identity retained when records are inserted or reordered. */ key: string; /** Human-readable event heading. */ title: string; /** Supporting detail, rendered as literal text. */ description?: undefined | string; /** Already formatted time label; the component does not choose a locale or time zone. */ time?: string | undefined; /** Valid HTML datetime value, supplied separately from the display label. */ dateTime?: string | undefined; /** Semantic indicator and default status label; omission renders a neutral ring without a label. */ status?: undefined | "neutral" | "info" | "success" | "warning" | "danger"; /** Override the status text; an empty string intentionally hides it. */ statusLabel?: string | undefined; /** Registered decorative icon name; the indicator slot takes precedence. */ icon?: string | undefined; }; /** Index in the original items array. */ index: number; }descriptionSupporting event description.
{ /** Original event object. */ item: { /** Unique identity retained when records are inserted or reordered. */ key: string; /** Human-readable event heading. */ title: string; /** Supporting detail, rendered as literal text. */ description?: undefined | string; /** Already formatted time label; the component does not choose a locale or time zone. */ time?: string | undefined; /** Valid HTML datetime value, supplied separately from the display label. */ dateTime?: string | undefined; /** Semantic indicator and default status label; omission renders a neutral ring without a label. */ status?: undefined | "neutral" | "info" | "success" | "warning" | "danger"; /** Override the status text; an empty string intentionally hides it. */ statusLabel?: string | undefined; /** Registered decorative icon name; the indicator slot takes precedence. */ icon?: string | undefined; }; /** Index in the original items array. */ index: number; }contentAdditional details and host-owned actions below the description.
{ /** Original event object. */ item: { /** Unique identity retained when records are inserted or reordered. */ key: string; /** Human-readable event heading. */ title: string; /** Supporting detail, rendered as literal text. */ description?: undefined | string; /** Already formatted time label; the component does not choose a locale or time zone. */ time?: string | undefined; /** Valid HTML datetime value, supplied separately from the display label. */ dateTime?: string | undefined; /** Semantic indicator and default status label; omission renders a neutral ring without a label. */ status?: undefined | "neutral" | "info" | "success" | "warning" | "danger"; /** Override the status text; an empty string intentionally hides it. */ statusLabel?: string | undefined; /** Registered decorative icon name; the indicator slot takes precedence. */ icon?: string | undefined; }; /** Index in the original items array. */ index: number; }emptyEmpty-list content; no fake event is inserted.
any
Events 组件事件
无自定义事件。