mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-08 17:26:41 +08:00
feat: 根据路由 meta 动态调整 footer 高度
This commit is contained in:
@@ -56,9 +56,18 @@ export default defineComponent({
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// 👉 根据路由 meta 决定 footer 高度
|
||||||
|
const shouldShowFooter = !route.meta.hideFooter
|
||||||
|
|
||||||
// 👉 Footer
|
// 👉 Footer
|
||||||
const footer = h('footer', { class: 'layout-footer' }, [
|
const footer = h('footer', { class: 'layout-footer' }, [
|
||||||
h('div', { class: 'footer-content-container' }, slots.footer?.()),
|
h(
|
||||||
|
'div',
|
||||||
|
{
|
||||||
|
class: ['footer-content-container', !shouldShowFooter && 'footer-content-container-noheight'],
|
||||||
|
},
|
||||||
|
slots.footer?.(),
|
||||||
|
),
|
||||||
])
|
])
|
||||||
|
|
||||||
// 👉 Overlay
|
// 👉 Overlay
|
||||||
@@ -69,9 +78,6 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
// 👉 修改:根据路由 meta 决定是否显示 footer
|
|
||||||
const shouldShowFooter = !route.meta.hideFooter
|
|
||||||
|
|
||||||
return h(
|
return h(
|
||||||
'div',
|
'div',
|
||||||
{
|
{
|
||||||
@@ -83,11 +89,7 @@ export default defineComponent({
|
|||||||
scrollDistance.value && 'window-scrolled',
|
scrollDistance.value && 'window-scrolled',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
[
|
[verticalNav, h('div', { class: 'layout-content-wrapper' }, [navbar, main, footer]), layoutOverlay],
|
||||||
verticalNav,
|
|
||||||
h('div', { class: 'layout-content-wrapper' }, [navbar, main, shouldShowFooter && footer]),
|
|
||||||
layoutOverlay,
|
|
||||||
],
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -65,6 +65,10 @@ body,
|
|||||||
block-size: variables.$layout-vertical-nav-footer-height;
|
block-size: variables.$layout-vertical-nav-footer-height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.footer-content-container-noheight {
|
||||||
|
block-size: 0px !important;
|
||||||
|
}
|
||||||
|
|
||||||
.layout-footer-sticky & {
|
.layout-footer-sticky & {
|
||||||
position: sticky;
|
position: sticky;
|
||||||
inset-block-end: 0;
|
inset-block-end: 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user