跳到主要内容

Sample 合同 · AUP 跨设备 · ARC 2.0.0-beta.28

`table` primitive

用 table primitive 呈现列式数据;区分 GFM 表与 chart 降级表。

table 是 AUP 跨设备 primitive,不是 Web Device 的 layout 组件,也不是 Web-only widget。它属于 AUP_PRIMITIVES 中的 18 个名称之一,并出现在每个 target 的 DeviceCaps.primitives map 中(取值为 native、webview、partial 或 unsupported)。

合同

字段值
Primitive 名称table
层级AUP 跨设备 primitive(AUP_PRIMITIVES)
公共状态released
Document 能力native
共享 degradation chain空 AUP table → “No data” 正文(不是 degradation chain)
作者入口AUP tree(columns/rows)· GFM pipe 表(Markdown 路径,常为 HTML text)
Document renderer / 备注renderer/primitives/table.ts
Showcase 证据report / finance 组合;GFM 路径在 document 单元页已验证

何时使用

需要作为 AUP table 节点的语义行列,或内容 Markdown 中的静态 GFM 表时。

何时不要使用

不要把 chart 降级表与作者编写的表混淆。GFM 表不是深层 AUP table props 合同。

Sample 合同

字段值
目的docs 中的静态列式内容(GFM 路径)
边界不是可编辑网格;不是 chart fallback chrome;不是全部 AUP table props 组合
作者入口Markdown pipe 表
表面Web Device document
公共状态released(GFM 路径已验证)
Fallback / 失败畸形 pipe → 普通 Markdown / 坏表;空 AUP table → “No data”(AUP 路径)
验证下方路由 · arc --version = 2.0.0-beta.28

Document sample(GFM 表)

这是 document target 上的 Markdown/GFM 路径。它不是每个 AUP table props 组合的 live 声明。

源码:

markdown
| File | Purpose | Writes data |
| --- | --- | --- |
| `content.md` | Content item | No |
| `layout.aup` | Page layout | No |

渲染:

FilePurposeWrites data
content.mdContent itemNo
layout.aupPage layoutNo

单元页:GFM table。

AUP 节点形状(本页 source-only)

交互 / full-web 写作使用显式 columns / rows。空 AUP table 渲染 “No data” 单元格。该字符串是 table 空态 chrome,不是 chart 的证据。

json
{
  "id": "rates",
  "type": "table",
  "props": {
    "columns": [
      { "key": "name", "label": "Name" },
      { "key": "value", "label": "Value" }
    ],
    "rows": [{ "name": "alpha", "value": "1" }]
  }
}

失败与限制

情形预期结果
畸形 pipe普通 Markdown / 坏表,不是 runtime 错误面
GFM 空数据行仅作者内容——不会自动出现 chart chain 的 “No data” chrome
从 GFM sample 假定 AUP table props路径深度不对;需要该节点时写 AUP JSON/DSL
Chart 降级表独立的 unsupported chart 路径——不是本 sample

验证证据

项值
基线2026-08-09 · arc --version → 2.0.0-beta.28
能力行docs/aup/capability-matrix.md(内部,不对外路由)· table · GFM table
实现content-reader.ts(table case);renderer/primitives/table.ts
公开路由/en/docs/aup/primitives/table/ · /zh/docs/aup/primitives/table/
本地运行arc service start --blocklet blocklets/arcblock --port 4900 · 打开路由;对照源码与渲染表
接受标准源码与渲染表一致;无编辑控件;无 chart 声明

证据锚点

项值
注册表packages/aup/src/aup-types.ts · AUP_PRIMITIVES
Document capsproviders/runtime/web-device/src/device-caps.ts · DEVICE_CAPS_DOCUMENT
Degradationpackages/aup/src/degradation.ts · DEGRADATION_CHAINS
内部矩阵docs/aup/capability-matrix.md(内部,不对外路由)
Taxonomy hubPrimitive 类型分类与证据
Sample 合同规则Live 示例:范围与合同

相关页面