release-notes.mdMarkdown · 12 KB
消息附件
消息附件展示与单条消息关联的文件、图片、源码范围或 URL。上传和持久化由宿主应用负责。
安装Terminal
用法
参数
状态与变体
上传失败后保留附件,以便重试或移除。源码范围不存在时应说明不可用文件和恢复方式。
无障碍
移除和重试按钮标签包含附件名。文件类型图标作为装饰并对辅助技术隐藏。
消息附件展示与单条消息关联的文件、图片、源码范围或 URL。上传和持久化由宿主应用负责。
npm install @a3s-lab/ui@0.4.0<article class="message-attachment" data-state="complete">
<figure aria-hidden="true">...</figure>
<div data-attachment-identity><strong>release-notes.md</strong><span data-attachment-meta>Markdown · 12 KB</span></div>
<button type="button" aria-label="移除 release-notes.md">...</button>
</article>import "@a3s-lab/ui/a3s.css";
import "@a3s-lab/ui/all";<article class="message-attachment" data-state="complete">
<figure aria-hidden="true">...</figure>
<div data-attachment-identity><strong>release-notes.md</strong><span data-attachment-meta>Markdown · 12 KB</span></div>
<button type="button" aria-label="移除 release-notes.md">...</button>
</article>| API | 取值 | 用途 |
|---|---|---|
data-state | ready、uploading、complete、missing、error | 附件生命周期 |
data-attachment-identity | 必须 | 名称、类型或源码范围 |
data-attachment-meta | 可选 | 大小、上传进度或路径 |
上传失败后保留附件,以便重试或移除。源码范围不存在时应说明不可用文件和恢复方式。
移除和重试按钮标签包含附件名。文件类型图标作为装饰并对辅助技术隐藏。
