2024-08-11 16:29:39 +08:00
|
|
|
<script setup lang="ts">
|
2024-08-11 20:05:52 +08:00
|
|
|
import type { Props } from './page';
|
2024-08-11 16:29:39 +08:00
|
|
|
|
|
|
|
import PageFooter from './page-footer.vue';
|
|
|
|
import PageHeader from './page-header.vue';
|
|
|
|
|
|
|
|
defineOptions({
|
|
|
|
name: 'Page',
|
|
|
|
});
|
|
|
|
|
|
|
|
const props = withDefaults(defineProps<Props>(), {
|
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 20:05:52 +08:00
|
|
|
<PageHeader
|
|
|
|
v-if="description || $slots.description || title"
|
|
|
|
:title="props.title"
|
|
|
|
>
|
2024-08-11 16:29:39 +08:00
|
|
|
<template #default>
|
2024-08-11 20:05:52 +08:00
|
|
|
<template v-if="description">{{ description }}</template>
|
|
|
|
<slot v-else name="description"></slot>
|
2024-08-11 16:29:39 +08:00
|
|
|
</template>
|
|
|
|
</PageHeader>
|
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>
|
|
|
|
<PageFooter v-if="props.showFooter">
|
|
|
|
<template #default>
|
|
|
|
<slot name="footer"></slot>
|
|
|
|
</template>
|
|
|
|
</PageFooter>
|
|
|
|
</div>
|
|
|
|
</template>
|