fix: update content height calculation and improve rendering logic in page component

pull/56/head
chenminjie 2024-12-02 19:27:37 +08:00
parent 662c8f7a47
commit f85f1136c5
1 changed files with 7 additions and 2 deletions

View File

@ -48,7 +48,7 @@ async function calcContentHeight() {
return; return;
} }
await nextTick(); await nextTick();
const { getLayoutFooterHeight } = useLayoutFooterStyle(); const { getLayoutFooterHeight } = await useLayoutFooterStyle();
headerHeight.value = headerRef.value?.offsetHeight || 0; headerHeight.value = headerRef.value?.offsetHeight || 0;
footerHeight.value = getLayoutFooterHeight() || 0; footerHeight.value = getLayoutFooterHeight() || 0;
setTimeout(() => { setTimeout(() => {
@ -91,7 +91,12 @@ onMounted(() => {
</div> </div>
</div> </div>
<div :class="contentClass" :style="contentStyle" class="h-full p-4"> <div
v-if="shouldAutoHeight"
:class="contentClass"
:style="contentStyle"
class="h-full p-4"
>
<slot></slot> <slot></slot>
</div> </div>