iter(e04): 新增 empty 空状态组件
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user