2024-08-11 16:29:39 +08:00
|
|
|
<script setup lang="ts">
|
2024-08-11 21:01:22 +08:00
|
|
|
interface Props {
|
|
|
|
title?: string;
|
|
|
|
description?: string;
|
|
|
|
contentClass?: string;
|
|
|
|
showFooter?: boolean;
|
|
|
|
}
|
2024-08-11 16:29:39 +08:00
|
|
|
|
|
|
|
defineOptions({
|
|
|
|
name: 'Page',
|
|
|
|
});
|
|
|
|
|
|
|
|
const props = withDefaults(defineProps<Props>(), {
|
2024-08-11 21:01:22 +08:00
|
|
|
contentClass: '',
|
2024-08-11 20:05:52 +08:00
|
|
|
description: '',
|
2024-08-11 16:29:39 +08:00
|
|
|
showFooter: false,
|
|
|
|
title: '',
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<div class="relative h-full">
|
2024-08-11 21:01:22 +08:00
|
|
|
<div
|
2024-08-11 20:05:52 +08:00
|
|
|
v-if="description || $slots.description || title"
|
2024-08-11 21:01:22 +08:00
|
|
|
class="bg-card px-6 py-4"
|
2024-08-11 20:05:52 +08:00
|
|
|
>
|
2024-08-12 21:05:01 +08:00
|
|
|
<slot name="title">
|
|
|
|
<div
|
|
|
|
v-if="title"
|
|
|
|
class="mb-2 flex justify-between text-lg font-semibold"
|
|
|
|
>
|
|
|
|
{{ title }}
|
2024-08-28 22:26:35 +08:00
|
|
|
|
|
|
|
<slot name="extra"></slot>
|
2024-08-12 21:05:01 +08:00
|
|
|
</div>
|
|
|
|
</slot>
|
|
|
|
|
|
|
|
<slot name="description">
|
|
|
|
<p v-if="description" class="text-muted-foreground">
|
|
|
|
{{ description }}
|
|
|
|
</p>
|
|
|
|
</slot>
|
2024-08-11 21:01:22 +08:00
|
|
|
</div>
|
|
|
|
|
2024-08-11 20:05:52 +08:00
|
|
|
<div :class="contentClass" class="m-4">
|
2024-08-11 16:29:39 +08:00
|
|
|
<slot></slot>
|
|
|
|
</div>
|
2024-08-11 21:01:22 +08:00
|
|
|
|
|
|
|
<div
|
|
|
|
v-if="props.showFooter"
|
|
|
|
class="bg-card align-center absolute bottom-0 left-0 right-0 flex px-6 py-4"
|
|
|
|
>
|
|
|
|
<slot name="footer"></slot>
|
|
|
|
</div>
|
2024-08-11 16:29:39 +08:00
|
|
|
</div>
|
|
|
|
</template>
|