feat: page component (#4087)
* feat: page component * chore: basic page * chore: add demos * chore: add header-sticky support * chore: update web-ele * chore: rename slot name --------- Co-authored-by: Vben <ann.vben@gmail.com>
This commit is contained in:
34
packages/effects/common-ui/src/page/page.vue
Normal file
34
packages/effects/common-ui/src/page/page.vue
Normal file
@@ -0,0 +1,34 @@
|
||||
<script setup lang="ts">
|
||||
import type { Props } from './page.ts';
|
||||
|
||||
import PageFooter from './page-footer.vue';
|
||||
import PageHeader from './page-header.vue';
|
||||
|
||||
defineOptions({
|
||||
name: 'Page',
|
||||
});
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
showFooter: false,
|
||||
showHeader: true,
|
||||
title: '',
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="relative h-full">
|
||||
<PageHeader v-if="props.showHeader" :title="props.title">
|
||||
<template #default>
|
||||
<slot name="header"></slot>
|
||||
</template>
|
||||
</PageHeader>
|
||||
<div class="m-4 overflow-hidden">
|
||||
<slot></slot>
|
||||
</div>
|
||||
<PageFooter v-if="props.showFooter">
|
||||
<template #default>
|
||||
<slot name="footer"></slot>
|
||||
</template>
|
||||
</PageFooter>
|
||||
</div>
|
||||
</template>
|
Reference in New Issue
Block a user