Result 用于任务完成后的结果页,以及无权限、资源不存在等需要说明下一步的内容区域。 就近的简短提示使用 Alert,空列表和无搜索结果使用 EmptyState。
基本用法
title 描述结果,description 补充原因或下一步。默认展示信息图标,
内容区采用中性文字,不需要再套一层提示框。
结果状态
status 控制图标和语义色,可选 info、success、warning、error、forbidden 和 not-found。
小图标使用对应状态的 source 色:信息与资源缺失为信息色,无权限与警告为警告色,成功与失败各用对应状态色。
状态不生成默认标题,也不自动跳转;文案始终由你提供。
结果插图
设置 illustrated,按 status 显示对应的内置线描插图,适合独立结果区。
插图轮廓保持中性;信息、无权限和资源缺失的装饰标记也保持中性,成功、警告和失败的标记使用 source 色。
默认保持小图标;开启插图后,默认紧凑型 sm 宽 96px,显式设置 md 则宽 144px,并随窄容器收缩。切换下方开关可比较图标、插图与尺寸。
恢复与重试
在 actions 插槽放入按钮。请求、忙碌、重试次数和结果更新由页面管理;
下面的本地模拟第一次重试失败,第二次成功,重试过程中会保留当前说明。
详细内容
默认插槽位于说明与操作之间,可展示回执、未完成条目或排错信息。 详细内容采用左对齐,并随容器宽度换行。
紧凑与长文本
默认 size="sm" 使用紧凑的留白、图标和标题;需要更大的独立结果区时设置 size="md"。
titleAs 选择符合页面结构的标题层级,默认 h3;尺寸不会改写内部按钮的尺寸。
图标与自定义内容
icon 接收已注册图标名,false 隐藏默认图标;开启插图时不影响插图显示。
icon、title、description 插槽可替换对应内容;所有插槽提供当前 status 和 size。
自定义插图只承担装饰作用,操作控件应放在 actions 中。
自定义插图
illustration 插槽替换内置插图,也可以独立使用,无需设置 illustrated。
它优先于内置插图和 icon,接收当前 status、size。自定义 SVG 或图片设置 width: 100%、height: auto,按 20:13 比例设计可与内置图保持一致。
可访问性
- 整组按普通内容读取,通过可见标题命名;
label可提供单独的辅助名称。 - 图标不单独播报,标题与说明应明确表达结果。
- 动态结果需要播报时,在页面提供简短的
role="status"提示;组件不会自动抢焦点或重复播报详细内容。 - 操作完成后若按钮被移除,页面负责将焦点放到结果标题或下一处可操作位置。
API
QuireResult Props
Slots 内容位置
illustrationDecorative artwork, shown even without illustrated; takes precedence over built-in art and icons.
{ /** Current outcome status. */ status: "info" | "success" | "warning" | "error" | "forbidden" | "not-found"; /** Current presentation size. */ size: "sm" | "md"; }iconDecorative icon or illustration; meaningful explanations belong in the title or description.
{ /** Current outcome status. */ status: "info" | "success" | "warning" | "error" | "forbidden" | "not-found"; /** Current presentation size. */ size: "sm" | "md"; }titleVisible title content, retaining the native heading and accessible association.
{ /** Current outcome status. */ status: "info" | "success" | "warning" | "error" | "forbidden" | "not-found"; /** Current presentation size. */ size: "sm" | "md"; }descriptionExplanation content, retaining the accessible description association.
{ /** Current outcome status. */ status: "info" | "success" | "warning" | "error" | "forbidden" | "not-found"; /** Current presentation size. */ size: "sm" | "md"; }defaultAdditional result details, such as failed items or a receipt.
{ /** Current outcome status. */ status: "info" | "success" | "warning" | "error" | "forbidden" | "not-found"; /** Current presentation size. */ size: "sm" | "md"; }actionsButtons or navigation controls arranged after the result details.
{ /** Current outcome status. */ status: "info" | "success" | "warning" | "error" | "forbidden" | "not-found"; /** Current presentation size. */ size: "sm" | "md"; }
Events 组件事件
无自定义事件。