diff --git a/src/components/PageTransition.vue b/src/components/PageTransition.vue index ddacfd7..f6207fa 100644 --- a/src/components/PageTransition.vue +++ b/src/components/PageTransition.vue @@ -64,7 +64,7 @@ function calcDepth(sourceRoute: RouteLocationNormalized): number { } const unregisterGuard = router.beforeEach((to, from) => { - if (to.meta.tabBarVisible && from.meta.tabBarVisible) { + if (to.meta.tabBarRoot && from.meta.tabBarRoot) { transitionName.value = ""; hasTransition.value = false; return; @@ -100,14 +100,16 @@ onUnmounted(() => { .page-transition { width: 100%; - height: 100%; + display: grid; + min-height: 100%; position: relative; overflow-x: hidden; .pages { - inset: 0; - height: 100%; - position: absolute; + grid-area: 1 / 1; + width: 100%; + min-height: 100%; + position: relative; background: v-bind(pageBackground); overflow-x: hidden; } @@ -116,10 +118,9 @@ onUnmounted(() => { .push-left-leave-active, .push-right-enter-active, .push-right-leave-active { - inset: 0; + grid-area: 1 / 1; width: 100%; - height: 100%; - position: absolute; + min-height: 100%; transition: transform @duration @easing, opacity .2s linear; backface-visibility: hidden; } diff --git a/src/layout/MainLayout.vue b/src/layout/MainLayout.vue index 30e300b..2792168 100644 --- a/src/layout/MainLayout.vue +++ b/src/layout/MainLayout.vue @@ -14,7 +14,7 @@ -
+
{ if (navBarStore.isShowing) { - return "3rem"; + return `${navBarStore.height || 48}px`; } return "0"; @@ -97,10 +97,18 @@ const tabList = [ { value: "/settings", icon: "setting" } ]; +function resolveTabValue(path: string): string { + if (path === "/" || path.startsWith("/files/")) { + return "/"; + } + + return path; +} + watch( () => route.path, (newPath: string) => { - tabVal.value = newPath; + tabVal.value = resolveTabValue(newPath); }, { immediate: true } ); @@ -125,19 +133,29 @@ const tabBarPadding = computed(() => { return "0rem"; }); +const isContentFixedHeight = computed(() => { + return route.meta.contentFixedHeight === true; +}); + const bodyHeight = computed(() => { - return `calc(100% - ${navBarPadding.value} - ${tabBarPadding.value})`; + return `calc(100vh - ${navBarPadding.value} - ${tabBarPadding.value})`; });