feat: add CloseButton Avatar and Skeleton components
This commit is contained in:
@@ -0,0 +1,148 @@
|
||||
---
|
||||
title: AvatarGroup 头像组
|
||||
description: 以叠放或网格展示多个头像,并支持溢出计数
|
||||
component: avatar-group
|
||||
group: 组件
|
||||
---
|
||||
|
||||
## 用法
|
||||
|
||||
```vue
|
||||
<script setup lang="ts">
|
||||
import {
|
||||
Avatar,
|
||||
AvatarGroup,
|
||||
AvatarImage,
|
||||
AvatarFallback,
|
||||
} from "@heroui-vue/components";
|
||||
</script>
|
||||
```
|
||||
|
||||
<ComponentPreview name="avatar-group-basic" />
|
||||
|
||||
## 组件结构
|
||||
|
||||
```vue
|
||||
<script setup lang="ts">
|
||||
import {
|
||||
Avatar,
|
||||
AvatarGroup,
|
||||
AvatarGroupCount,
|
||||
AvatarImage,
|
||||
AvatarFallback,
|
||||
} from "@heroui-vue/components";
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AvatarGroup>
|
||||
<Avatar>
|
||||
<AvatarImage />
|
||||
<AvatarFallback />
|
||||
</Avatar>
|
||||
<AvatarGroupCount><!-- 可选的显式子组件 --></AvatarGroupCount>
|
||||
</AvatarGroup>
|
||||
</template>
|
||||
```
|
||||
|
||||
## 示例
|
||||
|
||||
### 最大数量
|
||||
|
||||
<ComponentPreview name="avatar-group-max" />
|
||||
|
||||
### 自定义计数
|
||||
|
||||
<ComponentPreview name="avatar-group-count" />
|
||||
|
||||
### 尺寸
|
||||
|
||||
<ComponentPreview name="avatar-group-sizes" />
|
||||
|
||||
### 网格
|
||||
|
||||
<ComponentPreview name="avatar-group-grid" />
|
||||
|
||||
### 叠放样式(Overlap)
|
||||
|
||||
<ComponentPreview name="avatar-group-overlap" />
|
||||
|
||||
## 自定义样式
|
||||
|
||||
### Tailwind CSS
|
||||
|
||||
<ComponentPreview name="avatar-group-custom-styles" />
|
||||
|
||||
### 全局 CSS
|
||||
|
||||
可使用 `@layer components` 指令自定义 AvatarGroup 组件类。
|
||||
|
||||
```css
|
||||
@layer components {
|
||||
.hv-avatar-group {
|
||||
--avatar-group-overlap: 0.75rem;
|
||||
--avatar-group-seam: 2px;
|
||||
}
|
||||
|
||||
.hv-avatar-group__count {
|
||||
@apply font-semibold;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 样式参考
|
||||
|
||||
HeroUI 遵循 [BEM](https://getbem.com/) 方法论,确保组件变体与状态可复用且易于自定义。
|
||||
|
||||
### CSS 类
|
||||
|
||||
AvatarGroup 组件使用以下 CSS 类:
|
||||
|
||||
#### 基础类 [!toc]
|
||||
|
||||
- `.hv-avatar-group` - 头像组基础容器
|
||||
- `.hv-avatar-group--grid` - 网格布局修饰符(无叠放)
|
||||
- `.hv-avatar-group--clip` - 新月裁切 / 透明缝(默认叠放)
|
||||
- `.hv-avatar-group--ring` - 通过 `--background` 的实线 box-shadow 描边
|
||||
- `.hv-avatar-group__count` - 溢出计数头像
|
||||
|
||||
叠放布局在兄弟元素之间使用负外边距(`--avatar-group-overlap`,默认 `0.5rem`)。clip 模式对非末子头像做遮罩,并光学微调 fallback 字形;ring 模式使用 `--background` 细线 box-shadow 描边。
|
||||
|
||||
## API 参考
|
||||
|
||||
### AvatarGroup
|
||||
|
||||
| Prop | 类型 | 默认值 | 描述 |
|
||||
| --------- | ------------------------------------------------------------- | -------- | -------------------------------------------------------------------------- |
|
||||
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | 当子 Avatar 未指定 `size` 时应用到子头像(及溢出计数);默认与 Avatar 一致 |
|
||||
| `color` | `'default' \| 'accent' \| 'success' \| 'warning' \| 'danger'` | - | 当子 Avatar 未指定 `color` 时,应用到子头像(及溢出计数)的颜色 |
|
||||
| `variant` | `'default' \| 'soft'` | - | 当子 Avatar 未指定 `variant` 时,应用到子头像(及溢出计数)的变体 |
|
||||
| `max` | `number` | - | 最多渲染的头像子项数量;省略则显示全部 |
|
||||
| `isGrid` | `boolean` | `false` | 是否使用无叠放的换行网格布局 |
|
||||
| `overlap` | `'clip' \| 'ring'` | `'clip'` | 叠放样式:新月裁切(默认)或 box-shadow 描边;`isGrid` 时忽略 |
|
||||
| `class` | `string` | - | 附加 CSS 类 |
|
||||
| 默认插槽 | `Avatar[] \| AvatarGroupCount` | - | 要组合的 Avatar 组件(以及可选的 `AvatarGroupCount`) |
|
||||
|
||||
### AvatarGroupCount
|
||||
|
||||
由 `Avatar` + `AvatarFallback` 组合而成,用于溢出指示。不受 `max` 截断。
|
||||
|
||||
| Prop | 类型 | 默认值 | 描述 |
|
||||
| --------- | ------------------------------------------------------------- | ------ | --------------------- |
|
||||
| 默认插槽 | `string \| Component` | - | 计数内容(例如 `+3`) |
|
||||
| `size` | `'sm' \| 'md' \| 'lg'` | - | 覆盖组的尺寸 |
|
||||
| `color` | `'default' \| 'accent' \| 'success' \| 'warning' \| 'danger'` | - | 覆盖组的颜色 |
|
||||
| `variant` | `'default' \| 'soft'` | - | 覆盖组的变体 |
|
||||
| `class` | `string` | - | 附加 CSS 类 |
|
||||
|
||||
## 注意事项
|
||||
|
||||
- AvatarGroup 通过 provide/inject 仅向**直接 Avatar 子组件**传递 `size`、`color` 与 `variant`
|
||||
- 设置 `max` 会截断可见头像并根据剩余子项自动计数;省略则显示全部
|
||||
- 已知总量(例如来自服务端)时,渲染显式的 `AvatarGroupCount` — 它不受 `max` 截断,并会抑制自动计数。请用 `Count` 替代已移除的 v2 `total`
|
||||
- `isGrid` 会禁用叠放,改为换行网格布局
|
||||
- `overlap` 默认为 `"clip"`(新月裁切);使用 `"ring"` 可改为实线描边;与 `isGrid` 同时使用时无效
|
||||
- 默认不加 `role="group"` — 当叠放有语义(指派人、在看的人)时,自行加上 `role="group"`,并配合 `aria-label` 或 `aria-labelledby`
|
||||
|
||||
## 相关组件
|
||||
|
||||
[Avatar 头像](./avatar) · [Card 卡片](./card)
|
||||
@@ -0,0 +1,149 @@
|
||||
---
|
||||
title: Avatar 头像
|
||||
description: 显示用户头像,支持自定义 fallback 内容
|
||||
component: avatar
|
||||
group: 组件
|
||||
---
|
||||
|
||||
## 用法
|
||||
|
||||
```vue
|
||||
<script setup lang="ts">
|
||||
import { Avatar, AvatarImage, AvatarFallback } from "@heroui-vue/components";
|
||||
</script>
|
||||
```
|
||||
|
||||
<ComponentPreview name="avatar-basic" />
|
||||
|
||||
## 组件结构
|
||||
|
||||
```vue
|
||||
<script setup lang="ts">
|
||||
import { Avatar, AvatarImage, AvatarFallback } from "@heroui-vue/components";
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Avatar>
|
||||
<AvatarImage />
|
||||
<AvatarFallback />
|
||||
</Avatar>
|
||||
</template>
|
||||
```
|
||||
|
||||
## 示例
|
||||
|
||||
### 尺寸
|
||||
|
||||
<ComponentPreview name="avatar-sizes" />
|
||||
|
||||
### 颜色
|
||||
|
||||
<ComponentPreview name="avatar-colors" />
|
||||
|
||||
### 变体
|
||||
|
||||
<ComponentPreview name="avatar-variants" />
|
||||
|
||||
### 回退内容
|
||||
|
||||
<ComponentPreview name="avatar-fallback" />
|
||||
|
||||
## 自定义样式
|
||||
|
||||
### 自定义图片组件
|
||||
|
||||
在 `AvatarImage` 上使用 `as-child`,即可与自定义图片组件组合。请将 `src` 传给 `AvatarImage`,以便跟踪加载状态,并在图片就绪前显示回退内容。
|
||||
|
||||
<ComponentPreview name="avatar-custom-image-component" />
|
||||
|
||||
### Tailwind CSS
|
||||
|
||||
<ComponentPreview name="avatar-custom-styles" />
|
||||
|
||||
### 全局 CSS
|
||||
|
||||
可使用 `@layer components` 指令自定义 Avatar 组件类。
|
||||
|
||||
```css
|
||||
@layer components {
|
||||
.hv-avatar {
|
||||
@apply size-16 border-2 border-accent;
|
||||
}
|
||||
|
||||
.hv-avatar__fallback {
|
||||
@apply bg-gradient-to-br from-purple-500 to-pink-500;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 样式参考
|
||||
|
||||
HeroUI 遵循 [BEM](https://getbem.com/) 方法论,确保组件变体与状态可复用且易于自定义。
|
||||
|
||||
### CSS 类
|
||||
|
||||
Avatar 组件使用以下 CSS 类:
|
||||
|
||||
#### 基础类 [!toc]
|
||||
|
||||
- `.hv-avatar` - 基础容器,默认尺寸(size-10)
|
||||
- `.hv-avatar__image` - 图片元素,aspect-square 尺寸
|
||||
- `.hv-avatar__fallback` - 居中内容的 fallback 容器
|
||||
|
||||
#### 尺寸修饰符 [!toc]
|
||||
|
||||
- `.hv-avatar--sm` - 小头像(size-8)
|
||||
- `.hv-avatar--md` - 中头像(默认,无额外样式)
|
||||
- `.hv-avatar--lg` - 大头像(size-12)
|
||||
|
||||
#### 变体修饰符 [!toc]
|
||||
|
||||
- `.hv-avatar--soft` - 浅色背景的 soft 变体
|
||||
|
||||
#### 颜色修饰符 [!toc]
|
||||
|
||||
- `.hv-avatar__fallback--default` - 默认文字颜色
|
||||
- `.hv-avatar__fallback--accent` - 强调色文字
|
||||
- `.hv-avatar__fallback--success` - 成功色文字
|
||||
- `.hv-avatar__fallback--warning` - 警告色文字
|
||||
- `.hv-avatar__fallback--danger` - 危险色文字
|
||||
|
||||
## API 参考
|
||||
|
||||
### Avatar
|
||||
|
||||
| Prop | 类型 | 默认值 | 描述 |
|
||||
| --------- | ------------------------------------------------------------- | ----------- | ----------------- |
|
||||
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | 头像尺寸 |
|
||||
| `color` | `'default' \| 'accent' \| 'success' \| 'warning' \| 'danger'` | `'default'` | Fallback 颜色主题 |
|
||||
| `variant` | `'default' \| 'soft'` | `'default'` | 视觉样式变体 |
|
||||
| `class` | `string` | - | 附加 CSS 类 |
|
||||
|
||||
### AvatarImage
|
||||
|
||||
| Prop | 类型 | 默认值 | 描述 |
|
||||
| ------------- | ---------------------------------- | ------- | ------------------------------------------ |
|
||||
| `src` | `string` | - | 图片 URL |
|
||||
| `srcSet` | `string` | - | 响应式图片的 `srcset` 属性 |
|
||||
| `sizes` | `string` | - | 响应式图片的 `sizes` 属性 |
|
||||
| `alt` | `string` | - | 图片替代文本 |
|
||||
| `asChild` | `boolean` | `false` | 将属性合并到子元素上,而不是渲染原生 `img` |
|
||||
| `@load` | `(event: Event) => void` | - | 图片加载成功时的回调 |
|
||||
| `@error` | `(event: Event) => void` | - | 图片加载失败时的回调 |
|
||||
| `crossOrigin` | `'anonymous' \| 'use-credentials'` | - | 图片请求的 CORS 设置 |
|
||||
| `loading` | `'eager' \| 'lazy'` | - | 原生懒加载属性 |
|
||||
| `class` | `string` | - | 附加 CSS 类 |
|
||||
|
||||
### AvatarFallback
|
||||
|
||||
| Prop | 类型 | 默认值 | 描述 |
|
||||
| --------- | ------------------------------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------- |
|
||||
| `delayMs` | `number` | - | 显示 fallback 前的延迟(防止闪烁)。`0` 与未指定不同:底座在 `delayMs=0` 时不会显示 fallback,需要延迟时请传正数 |
|
||||
| `color` | `'default' \| 'accent' \| 'success' \| 'warning' \| 'danger'` | - | 覆盖父级颜色(替换而非叠加) |
|
||||
| `class` | `string` | - | 附加 CSS 类 |
|
||||
|
||||
Avatar 使用 Reka UI 的 `AvatarRoot` / `AvatarImage` / `AvatarFallback` 处理加载与回退状态。`onLoad` / `onError` 对应 Vue 原生 `@load` / `@error` 事件,不声明与 React 合成事件完全等价。
|
||||
|
||||
## 相关组件
|
||||
|
||||
[AvatarGroup 头像组](./avatar-group) · [Card 卡片](./card)
|
||||
@@ -0,0 +1,109 @@
|
||||
---
|
||||
title: CloseButton 关闭按钮
|
||||
description: 用于关闭对话框、模态框或 dismiss 内容的按钮组件
|
||||
component: close-button
|
||||
group: 组件
|
||||
---
|
||||
|
||||
## 用法
|
||||
|
||||
```vue
|
||||
<script setup lang="ts">
|
||||
import { CloseButton } from "@heroui-vue/components";
|
||||
</script>
|
||||
```
|
||||
|
||||
<ComponentPreview name="close-button-default" />
|
||||
|
||||
## 示例
|
||||
|
||||
### 交互
|
||||
|
||||
<ComponentPreview name="close-button-interactive" />
|
||||
|
||||
### 自定义图标
|
||||
|
||||
<ComponentPreview name="close-button-with-custom-icon" />
|
||||
|
||||
## 自定义样式
|
||||
|
||||
### Tailwind CSS
|
||||
|
||||
<ComponentPreview name="close-button-custom-styles" />
|
||||
|
||||
### 全局 CSS
|
||||
|
||||
可使用 `@layer components` 指令自定义 CloseButton 组件类。
|
||||
|
||||
```css
|
||||
@layer components {
|
||||
.hv-close-button {
|
||||
@apply bg-red-100 text-red-800 hover:bg-red-200;
|
||||
}
|
||||
|
||||
.hv-close-button--custom {
|
||||
@apply rounded-full border-2 border-red-300;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 样式参考
|
||||
|
||||
HeroUI 遵循 [BEM](https://getbem.com/) 方法论,确保组件变体与状态可复用且易于自定义。
|
||||
|
||||
### CSS 类
|
||||
|
||||
CloseButton 组件使用以下 CSS 类:
|
||||
|
||||
#### 基础类 [!toc]
|
||||
|
||||
- `.hv-close-button` - 基础组件样式
|
||||
|
||||
#### 变体类 [!toc]
|
||||
|
||||
- `.hv-close-button--default` - 默认变体
|
||||
|
||||
### 交互状态
|
||||
|
||||
组件同时支持 CSS 伪类与 data 属性:
|
||||
|
||||
- **Hover**:`:hover` 或 `[data-hovered="true"]`
|
||||
- **Active/Pressed**:`:active` 或 `[data-pressed="true"]`
|
||||
- **Focus**:`:focus-visible` 或 `[data-focus-visible="true"]`
|
||||
- **Disabled**:`:disabled` 或 `[aria-disabled="true"]`
|
||||
|
||||
## API 参考
|
||||
|
||||
### CloseButton
|
||||
|
||||
| Prop | 类型 | 默认值 | 描述 |
|
||||
| ------------ | --------------------- | ------------ | -------------------------- |
|
||||
| `variant` | `"default"` | `"default"` | 按钮视觉变体 |
|
||||
| `isDisabled` | `boolean` | `false` | 是否禁用 |
|
||||
| 默认插槽 | `string \| Component` | 内置关闭图标 | 显示内容(默认为关闭图标) |
|
||||
|
||||
### 原生按钮属性
|
||||
|
||||
CloseButton 是原生 `button`,`type` 固定为 `"button"`。常用属性包括:
|
||||
|
||||
| Prop | 类型 | 描述 |
|
||||
| ------------------ | -------- | ------------------------------------ |
|
||||
| `aria-label` | `string` | 屏幕阅读器的无障碍标签,默认 `Close` |
|
||||
| `aria-labelledby` | `string` | 标注按钮的元素 ID |
|
||||
| `aria-describedby` | `string` | 描述按钮的元素 ID |
|
||||
|
||||
### 作用域插槽状态
|
||||
|
||||
| 参数 | 类型 | 描述 |
|
||||
| ---------------- | --------- | ---------------------- |
|
||||
| `isHovered` | `boolean` | 是否悬停 |
|
||||
| `isPressed` | `boolean` | 是否按下 |
|
||||
| `isFocused` | `boolean` | 是否聚焦 |
|
||||
| `isFocusVisible` | `boolean` | 是否显示键盘焦点指示器 |
|
||||
| `isDisabled` | `boolean` | 是否禁用 |
|
||||
|
||||
`onPress` 与 React Aria 的 PressEvent 不直接等价;Vue 使用原生 `@click` 与键盘事件。默认关闭图标来自固定基线 `CloseIcon`,可通过插槽替换为任意图标组件。
|
||||
|
||||
## 相关组件
|
||||
|
||||
[Button 按钮](./button) · [Card 卡片](./card)
|
||||
@@ -0,0 +1,185 @@
|
||||
---
|
||||
title: Skeleton 骨架屏
|
||||
description: Skeleton 用于展示加载状态,并预览组件的预期形状。
|
||||
component: skeleton
|
||||
group: 组件
|
||||
---
|
||||
|
||||
## 用法
|
||||
|
||||
```vue
|
||||
<script setup lang="ts">
|
||||
import { Skeleton } from "@heroui-vue/components";
|
||||
</script>
|
||||
```
|
||||
|
||||
<ComponentPreview name="skeleton-basic" />
|
||||
|
||||
## 示例
|
||||
|
||||
### 文本内容
|
||||
|
||||
<ComponentPreview name="skeleton-text-content" />
|
||||
|
||||
### 用户资料
|
||||
|
||||
<ComponentPreview name="skeleton-user-profile" />
|
||||
|
||||
### 列表项
|
||||
|
||||
<ComponentPreview name="skeleton-list" />
|
||||
|
||||
### 网格
|
||||
|
||||
<ComponentPreview name="skeleton-grid" />
|
||||
|
||||
### 单次闪烁
|
||||
|
||||
同步的 shimmer 效果会一次性扫过所有骨架元素。在父容器上应用 `hv-skeleton--shimmer` 类,并将子骨架的 `animationType` 设为 `"none"`。
|
||||
|
||||
<ComponentPreview name="skeleton-single-shimmer" />
|
||||
|
||||
### 动画类型
|
||||
|
||||
<ComponentPreview name="skeleton-animation-types" />
|
||||
|
||||
## 自定义样式
|
||||
|
||||
### Tailwind CSS
|
||||
|
||||
<ComponentPreview name="skeleton-custom-styles" />
|
||||
|
||||
### 全局 CSS
|
||||
|
||||
若要自定义组件类,可使用 `@layer components` 指令。
|
||||
|
||||
```css
|
||||
@layer components {
|
||||
/* Base skeleton styles */
|
||||
.hv-skeleton {
|
||||
@apply bg-surface-secondary/50; /* Change base background */
|
||||
}
|
||||
|
||||
/* Shimmer animation gradient */
|
||||
.hv-skeleton--shimmer::after {
|
||||
@apply via-surface-tertiary; /* Change shimmer gradient color */
|
||||
}
|
||||
|
||||
/* Pulse animation */
|
||||
.hv-skeleton--pulse {
|
||||
@apply animate-pulse opacity-75; /* Customize pulse animation */
|
||||
}
|
||||
|
||||
/* No animation variant */
|
||||
.hv-skeleton--none {
|
||||
@apply opacity-50; /* Style for static skeleton */
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 全局动画配置
|
||||
|
||||
可在全局 CSS 中通过 `--skeleton-animation` 变量为所有 Skeleton 组件设置默认动画类型:
|
||||
|
||||
```css
|
||||
/* 全局 CSS 文件 */
|
||||
:root {
|
||||
/* 可选值:shimmer、pulse、none */
|
||||
--skeleton-animation: pulse;
|
||||
}
|
||||
|
||||
/* 也可为浅色/深色主题设置不同值 */
|
||||
.light,
|
||||
[data-theme="light"] {
|
||||
--skeleton-animation: shimmer;
|
||||
}
|
||||
|
||||
.dark,
|
||||
[data-theme="dark"] {
|
||||
--skeleton-animation: pulse;
|
||||
}
|
||||
```
|
||||
|
||||
在单个组件上指定 `animation-type` 属性会覆盖此全局设置。
|
||||
|
||||
## 样式参考
|
||||
|
||||
HeroUI 遵循 [BEM](https://getbem.com/) 方法论,确保组件变体与状态可复用且易于自定义。
|
||||
|
||||
### CSS 类
|
||||
|
||||
Skeleton 使用以下 CSS 类:
|
||||
|
||||
#### 基础类 [!toc]
|
||||
|
||||
`.hv-skeleton` - 包含背景与圆角等基础骨架样式
|
||||
|
||||
#### 动画变体类 [!toc]
|
||||
|
||||
- `.hv-skeleton--shimmer` - 添加带渐变效果的闪烁动画(默认)
|
||||
- `.hv-skeleton--pulse` - 使用 Tailwind 的 `animate-pulse` 添加脉冲动画
|
||||
- `.hv-skeleton--none` - 无动画的静态骨架
|
||||
|
||||
### 动画
|
||||
|
||||
Skeleton 支持三种动画类型,视觉效果各不相同:
|
||||
|
||||
#### 闪烁动画 [!toc]
|
||||
|
||||
闪烁效果会在骨架元素上移动渐变:
|
||||
|
||||
```css
|
||||
.hv-skeleton--shimmer::after {
|
||||
@apply absolute inset-0 -translate-x-full animate-skeleton
|
||||
bg-linear-to-r from-transparent via-surface-tertiary to-transparent content-[''];
|
||||
}
|
||||
```
|
||||
|
||||
闪烁动画在主题中通过以下方式定义:
|
||||
|
||||
```css
|
||||
@theme inline {
|
||||
--animate-skeleton: skeleton 2s linear infinite;
|
||||
|
||||
@keyframes skeleton {
|
||||
100% {
|
||||
transform: translateX(200%);
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### 脉冲动画 [!toc]
|
||||
|
||||
脉冲动画使用 Tailwind 内置的 `animate-pulse` 工具类:
|
||||
|
||||
```css
|
||||
.hv-skeleton--pulse {
|
||||
@apply animate-pulse;
|
||||
}
|
||||
```
|
||||
|
||||
#### 无动画 [!toc]
|
||||
|
||||
用于不需要任何动画的静态骨架:
|
||||
|
||||
```css
|
||||
.hv-skeleton--none {
|
||||
/* No animation styles applied */
|
||||
}
|
||||
```
|
||||
|
||||
## API 参考
|
||||
|
||||
### Skeleton
|
||||
|
||||
| Prop | 类型 | 默认值 | 描述 |
|
||||
| --------------- | -------------------------------- | ----------------------- | ------------------------------------------------------------------------- |
|
||||
| `animationType` | `"shimmer" \| "pulse" \| "none"` | `"shimmer"` 或 CSS 变量 | Skeleton 的动画类型;也可通过 `--skeleton-animation` CSS 变量进行全局配置 |
|
||||
| `class` | `string` | - | 额外的 CSS 类名 |
|
||||
|
||||
`animationType` 未指定时,客户端挂载后读取 `--skeleton-animation`;服务端渲染与首次客户端渲染使用 `"shimmer"` 兜底。挂载后修改该 CSS 变量不会自动更新已渲染的 Skeleton。
|
||||
|
||||
## 相关组件
|
||||
|
||||
[Card 卡片](./card) · [Spinner 加载指示器](./spinner)
|
||||
Reference in New Issue
Block a user