组件
OneSkeleton
骨架块使用 --one-color-border 着色;animated 开启 one-skeleton-pulse 闪烁动画(默认开启)。
查看代码收起代码
import { OneSkeleton } from '@geektech/one';
new OneSkeleton({ rows: 3, title: true, avatar: true });ARIA
容器使用 role="status" 与 aria-busy,并通过 ariaLabel 表达加载语义;内部占位块对读屏隐藏。
API
| 名称 | 签名 | 说明 |
|---|---|---|
rows | rows?: number | 段落行数,默认 3。 |
title | title?: boolean | 显示标题条,默认 true。 |
avatar | avatar?: boolean | 显示圆形头像占位。 |
animated | animated?: boolean | 闪烁动画,默认 true。 |
widths | widths?: readonly string[] | 每行占位宽度,按序循环。 |
ariaLabel | ariaLabel?: string | 加载语义,默认“加载中”。 |