feat: integrate layout footer height calculation in page component

pull/56/head
chenminjie 2024-12-02 19:01:59 +08:00
parent 0d17a86c10
commit 662c8f7a47
1 changed files with 4 additions and 1 deletions

View File

@ -1,6 +1,8 @@
<script setup lang="ts">
import { computed, nextTick, onMounted, ref, useTemplateRef } from 'vue';
import { useLayoutFooterStyle } from '@vben/hooks';
interface Props {
title?: string;
description?: string;
@ -46,8 +48,9 @@ async function calcContentHeight() {
return;
}
await nextTick();
const { getLayoutFooterHeight } = useLayoutFooterStyle();
headerHeight.value = headerRef.value?.offsetHeight || 0;
footerHeight.value = footerRef.value?.offsetHeight || 0;
footerHeight.value = getLayoutFooterHeight() || 0;
setTimeout(() => {
shouldAutoHeight.value = true;
}, 30);