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-11 21:01:22 +08:00
|
|
|
<div class="mb-2 flex justify-between text-xl font-bold leading-10">
|
|
|
|
{{ title }}
|
|
|
|
</div>
|
|
|
|
<template v-if="description">{{ description }}</template>
|
|
|
|
<slot v-else name="description"></slot>
|
|
|
|
</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>
|