Files
JayuCloud/Frontend/src/App.vue
T

80 lines
1.5 KiB
Vue
Raw Normal View History

<template>
<el-config-provider>
<div class="app-container">
<BottomNav v-if="!isHiddenNav" />
<div class="page-content" :class="{ 'no-nav-padding': isHiddenNav }">
<router-view v-slot="{ Component }">
<transition name="page-fade" mode="out-in">
<component :is="Component" :key="route.path" />
</transition>
</router-view>
</div>
</div>
</el-config-provider>
</template>
<script setup lang="ts">
import { computed } from 'vue'
import { useRoute } from 'vue-router'
import BottomNav from './components/BottomNav.vue'
const route = useRoute()
const isHiddenNav = computed(() => {
2026-02-24 09:59:22 +08:00
return route.meta.hideNav as boolean
})
</script>
<style>
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: #2c3e50;
}
.app-container {
min-height: 100vh;
display: flex;
flex-direction: column;
position: relative;
}
.page-content {
flex: 1;
padding-bottom: 60px;
position: relative;
z-index: 1;
}
/* 当导航栏隐藏时,移除底部 padding */
.page-content.no-nav-padding {
padding-bottom: 0;
}
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.2s ease;
}
.fade-enter-from {
opacity: 0;
}
.fade-leave-to {
opacity: 0;
}
.page-fade-enter-active,
.page-fade-leave-active {
transition: opacity 0.2s ease;
}
.page-fade-enter-from {
opacity: 0;
}
.page-fade-leave-to {
opacity: 0;
}
</style>