iter(g99): 加载指示器补可定制播报
This commit is contained in:
@@ -4,7 +4,7 @@ import type { SpinnerProps } from './types.js';
|
||||
/*** 加载指示器:纯 CSS 旋转动画,size 控制直径 ***/
|
||||
export function spinner(props: SpinnerProps = {}): HTMLElement {
|
||||
const size = `${props.size ?? 18}px`;
|
||||
const el = h('span', { class: 'ua-spinner', role: 'status', 'aria-label': '加载中' }); // 读屏播报加载状态
|
||||
const el = h('span', { class: 'ua-spinner', role: 'status', 'aria-label': props.label ?? '加载中' }); // 读屏播报加载状态,label 可写明在加载什么
|
||||
el.style.width = size;
|
||||
el.style.height = size;
|
||||
return el;
|
||||
|
||||
@@ -312,7 +312,8 @@ export interface ToastProps {
|
||||
|
||||
/*** 加载指示器入参 ***/
|
||||
export interface SpinnerProps {
|
||||
size?: number; // 直径像素;缺省 18
|
||||
size?: number; // 直径像素;缺省 18
|
||||
label?: string; // 读屏播报文案,如「正在加载订单」;缺省「加载中」
|
||||
}
|
||||
|
||||
/*** 进度条入参 ***/
|
||||
|
||||
Reference in New Issue
Block a user