iter(e04): 新增 empty 空状态组件

This commit is contained in:
HIsheR
2026-10-23 18:11:47 +08:00
parent 62d4ce648d
commit fd4ee018e6
12 changed files with 172 additions and 9 deletions
+14
View File
@@ -0,0 +1,14 @@
import { h } from '@ui-arch/frame';
import type { EmptyProps } from './types.js';
/*** 空状态:居中占位提示,title/description 可选,action 放操作区(常见为按钮) ***/
export function empty(props: EmptyProps): HTMLDivElement {
return h(
'div',
{ class: 'ua-empty', role: 'status' }, // role=status 由读屏播报
h('div', { class: 'ua-empty-icon', 'aria-hidden': 'true' }, '⌀'), // 装饰符号,读屏跳过
props.title ? h('div', { class: 'ua-empty-title' }, props.title) : null,
props.description ? h('div', { class: 'ua-empty-desc' }, props.description) : null,
props.action ? h('div', { class: 'ua-empty-action' }, props.action) : null,
) as HTMLDivElement;
}