2025-12-10 20:52:44 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<Card class="overflow-hidden">
|
|
|
|
|
|
<!-- 标题和操作栏 -->
|
2025-12-12 16:15:07 +08:00
|
|
|
|
<div
|
|
|
|
|
|
v-if="$slots.header || title"
|
2025-12-13 22:26:09 +08:00
|
|
|
|
class="px-4 sm:px-6 py-3 sm:py-3.5 border-b border-border/60"
|
2025-12-12 16:15:07 +08:00
|
|
|
|
>
|
2025-12-10 20:52:44 +08:00
|
|
|
|
<slot name="header">
|
2025-12-13 22:26:09 +08:00
|
|
|
|
<div class="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 sm:gap-4">
|
2025-12-10 20:52:44 +08:00
|
|
|
|
<!-- 左侧:标题 -->
|
2025-12-13 22:26:09 +08:00
|
|
|
|
<h3 class="text-sm sm:text-base font-semibold shrink-0">
|
2025-12-12 16:15:07 +08:00
|
|
|
|
{{ title }}
|
|
|
|
|
|
</h3>
|
2025-12-10 20:52:44 +08:00
|
|
|
|
|
|
|
|
|
|
<!-- 右侧:操作区 -->
|
2025-12-12 16:15:07 +08:00
|
|
|
|
<div
|
|
|
|
|
|
v-if="$slots.actions"
|
2025-12-13 22:26:09 +08:00
|
|
|
|
class="flex flex-wrap items-center gap-2"
|
2025-12-12 16:15:07 +08:00
|
|
|
|
>
|
2025-12-10 20:52:44 +08:00
|
|
|
|
<slot name="actions" />
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</slot>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 表格内容 -->
|
|
|
|
|
|
<slot />
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 分页 -->
|
|
|
|
|
|
<slot name="pagination" />
|
|
|
|
|
|
</Card>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
|
import { Card } from '@/components/ui'
|
|
|
|
|
|
|
|
|
|
|
|
interface Props {
|
|
|
|
|
|
title?: string
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
defineProps<Props>()
|
|
|
|
|
|
</script>
|