# 11 组:Vue 独有页面 empty-state、header ## 事实记录:上游文档缺失此页 - 上游 `heroui/apps/docs/content/docs/{en,cn}/react/components/` 下**没有** empty-state、header 的组件页(无同名 mdx,分组 meta.json 无条目)。 - 但上游有完整实现与样式: - `heroui/packages/react/src/components/empty-state/{empty-state.tsx,index.ts}`、`heroui/packages/react/src/components/header/{header.tsx,index.ts}`(components/index.ts:63、67 导出) - `heroui/packages/styles/components/{empty-state,header}.css` + `heroui/packages/styles/src/components/{empty-state,header}/*.styles.ts` - 上游只是在别的页零散引用: - `(data-display)/table.mdx`「空状态」段:`Table.Body` 的 `renderEmptyState`(未单独讲 EmptyState 组件) - `(collections)/dropdown.mdx:24,41`、`(collections)/list-box.mdx:24,34,193`:分组结构里 `import { Header }`、`
`(无独立 Header 页与演示) - 因此 Vue 的 `heroui-vue/apps/docs/components/empty-state.md`、`header.md` 属自编页面;两页均已带自编声明(empty-state.md「基线说明」、header.md「说明」),`/tmp/audit/up_examples.json` 也无这两页条目(`vue_examples.json` 有:empty-state 4 例、header 3 例)。此事实本身按简报要求记录,自编不判为硬差异。 ### empty-state - [API] 未发现虚构:上游 `EmptyStateRootProps = DOMRenderProps + children/className`,`E` 默认 `"div"`,无任何变体(`empty-state.styles.ts` 仅 `tv({base:"empty-state"})`)。Vue 表 `as`(默认 `'div'`)/`class`/默认插槽与 `heroui-vue/packages/vue/src/components/empty-state/EmptyState.vue` 的 props 一致;`heroui-vue/packages/styles/src/index.ts:701` `emptyStateVariants` 同为 base-only。无虚构变体/slot/事件。 - [实现](轻微)回退语义与上游不一致且文档未标注:上游 `empty-state.tsx` 为 `children || "No results found"` 真值判断 —— `children={0}` 会回退默认文案、纯空白字符串 `" "`(truthy)原样渲染;Vue `EmptyState.vue` 的 `isMeaningful` 把 `0` 视为有效内容照常渲染、纯空白/注释回退默认文案。`empty-state.md`「只要存在有效内容(文本、数字或元素),就渲染调用方内容」写的是 Vue 语义,在 0 与空白字符串两个边界上与上游 `||` 语义相反。 - [样式] 无硬差异:`heroui/packages/styles/components/empty-state.css` 与 `heroui-vue/packages/styles/components/empty-state.css` 均为 `.empty-state{@apply p-2 text-sm text-muted}`(`hv-` 前缀归一化后 diff 仅剩许可注释);`/tmp/audit/css_semantic2.txt` 无 empty-state 条目。`empty-state.md`「样式参考」的类名与 `p-2 text-sm text-muted` 与 CSS 一致,"基线没有尺寸、颜色、变体或图标插槽"表述准确。 - [示例] 4 例(default / custom-content / conditional / custom-styles,`heroui-vue/apps/docs/demos/empty-state-*.vue`)全为自编(上游无官方演示),内容与真实能力吻合、未虚构 API/变体(只用 class + 默认插槽);conditional 例演示的 v-if 回退与组件行为一致。覆盖缺口:上游真实消费场景是 `table.stories.tsx:421` 的 `renderEmptyState`(图标 + 文案 `No results found`)与 combo-box/autocomplete stories 的空集合占位,empty-state.md 未给"集合为空"组合示例(`table-empty-state.vue` 似在 table 页覆盖,归属待核实)。 - [动画][配色] 无。 ### header - [API](文档事实错误,虚构上游能力)`header.md`「上游差异」表写"`Header.Root` 对象子部件"属于上游能力,但上游 `heroui/packages/react/src/components/header/index.ts` 是 `export const Header = HeaderRoot`,**没有** `.Root`(只有 EmptyState 用 `Object.assign(EmptyStateRoot, {Root})`)。该行描述的是不存在的上游 API。 - [API] 其余一致:上游 `HeaderRootProps = ComponentPropsWithRef`,无变体(`header.styles.ts` 仅 `tv({base:"header"})`);Vue 表 `as`(默认 `'header'`)/`class`/默认插槽与 `heroui-vue/packages/vue/src/components/header/HeaderRoot.vue` 一致;`index.ts:1199` `headerVariants` base-only。 - [API](琐碎)Vue 额外导出 `type HeaderVariants`(`heroui-vue/packages/vue/src/index.ts:627`),上游 `header/index.ts` 只导出 `headerVariants` 无该类型(EmptyState 才有 Variants 类型)。可忽略。 - [实现] Vue 多一段未入文档的行为:`HeaderRoot.vue` `inject(menuSectionLabelKey)` 在 MenuSection 内自动 `useId()` 并 `registerLabel(id)`(卸载时注销);上游由 RAC Collection `HeaderNode` 承担,属底座适配,但 `header.md` API 表未记录"id 自动生成/注册为分组标签"这一行为。 - [文档](stale,与仓库现状不符)`header.md` 称"菜单 / ListBox 尚未迁移时,可用语义容器解释组合边界"、上游差异表写"集合上下文由未来菜单族提供",但 `heroui-vue/packages/vue/src/components/` 已有 `menu`、`menu-section`、`list-box`、`combo-box`、`dropdown`,且 HeaderRoot 本身就 `import { menuSectionLabelKey } from "../menu/context"`。 - [文档](正确性核对通过)`header.md` 称 RAC `Header` 默认渲染原生 `
`:已核 react-aria-components `src/Header.tsx`(`dom.header`,`HeaderProps extends HTMLAttributes & DOMRenderProps<"header", undefined>`,createLeafComponent(HeaderNode)),表述正确;`render`→`as` 属框架映射。 - [样式] 无硬差异:双方 `.header{@apply w-full px-2 pt-1.5 pb-1 text-start text-xs font-medium text-muted}`(`heroui/packages/styles/components/header.css` vs `heroui-vue/packages/styles/components/header.css`,归一化 diff 仅注释:Vue 注释多 "(collection / group section heading)" 说明);`css_semantic2.txt` 无 header 条目;`header.md`「样式参考」数值与 CSS 一致。 - [示例] 3 例(basic / custom-class / semantic,`heroui-vue/apps/docs/demos/header-*.vue`)为自编,未虚构变体(只用 class 覆盖)。文案 `操作`、`危险区域` 恰与上游唯一真实用法 `heroui/apps/docs/src/demos/cn/dropdown/with-sections.tsx:15,45` 的 `
操作
`、`
危险区域
` 对应,内容合理。覆盖缺口:3 例都没在已迁移的 Dropdown.Section / MenuSection / ListBox 分组里演示 Header(上游 Header 的实际使用场景就是这些集合分组的标题,见 dropdown.mdx/list-box.mdx 的 `
`),示例只用自造 `
`/`
` 模拟。 - [动画][配色] 无。 ## 本组小结 1. `header.md`「上游差异」表虚构上游 `Header.Root` 对象子部件(上游 `header/index.ts` 无 `.Root`)—— 本组唯一虚构上游 API。 2. `header.md` 关于"菜单 / ListBox 尚未迁移、集合上下文由未来菜单族提供"的描述已过期:menu/list-box/combo-box/dropdown 均已迁移,HeaderRoot 已接 MenuSection label 注册,且该行为未写入 API 表。 3. EmptyState 回退边界与上游 `children || "No results found"` 有差异(`0` 上游回退/Vue 渲染;纯空白字符串上游渲染/Vue 回退),文档按 Vue 语义描述且未标注差异。 4. 两页均自编但已声明;CSS 与 tv 映射与上游逐字一致(仅 hv- 前缀与注释),无样式/动画/配色硬差异。 5. 示例覆盖合理但缺上游典型场景:header 未放进 Dropdown/ListBox 分组,empty-state 未给集合为空组合示例。