Skip to content

AppCard 增强卡片

增强型卡片组件,支持可配置阴影、圆角、悬停效果、玻璃态背景。提供 headeractionsdefaultfooter 四个插槽。

基本用法

vue
<template>
  <AppCard title="用户管理" icon="i-carbon-user" tag="NEW" tag-type="info">
    <p>卡片内容</p>

    <template #actions>
      <n-button size="small">操作</n-button>
    </template>

    <template #footer>
      <span>底部信息</span>
    </template>
  </AppCard>
</template>

<script setup>
import { AppCard } from '@/components/common'
</script>

带玻璃态和阴影

vue
<AppCard
  title="数据面板"
  glass
  shadow="xl"
  radius="lg"
  hover
>
  <p>Glassmorphism 风格卡片</p>
</AppCard>

Props

属性类型默认值说明
titleString卡片标题,设置后显示标题栏
iconString标题旁边显示的图标 CSS 类名
tagString标题栏小型标签文本
tagTypeString'default'标签 Naive UI 类型,如 infosuccesserror
borderedBooleantrue是否显示边框
hoverBooleanfalse启用悬停阴影加深效果
glassBooleanfalse启用玻璃态背景(backdrop-filter: blur
shadowString'md'阴影级别:nonexssmmdlgxl2xl
radiusString'lg'圆角级别:nonesmmdlgxl2xlfull
paddingBooleantrue是否对 body 区域应用默认内边距

Slots

插槽名说明
header自定义完整头部区域(替换默认标题+图标+标签行)
actions头部右侧操作按钮区域
default卡片主体内容
footer卡片底部固定区域(带顶部边框分隔线)

Forge Admin — 基于 Vue3 + Spring Boot 的企业级后台管理框架