跳到正文

Skeleton 骨架屏 ​

在内容加载完成前展示占位图形,减少用户等待焦虑,支持头像、文字行、段落与卡片等常见变体。

使用方式 ​

vue
<template>
  <em-skeleton variant="paragraph" :rows="4" />
</template>

变体 ​

动画 ​

默认开启闪烁动画,可通过 animated 关闭;自动尊重 prefers-reduced-motion 媒体查询。

API ​

Skeleton API ​

Props ​

属性类型默认值说明
variant'avatar' | 'text' | 'paragraph' | 'card''text'变体:avatar 头像 / text 单行文字 / paragraph 多行段落 / card 卡片
shape'circle' | 'square' | 'rounded''circle'avatar 形状:circle(默认)/ square / rounded
rowsnumber3段落行数,默认 3
animatedbooleantrue是否启用闪烁动画,默认 true
widthstring—自定义宽度(CSS 值),默认按变体自适应
heightstring—自定义高度(CSS 值),默认按变体自适应