2022-04-21 18:20:39 +08:00
|
|
|
<!-- 主视图 -->
|
|
|
|
<template>
|
|
|
|
<section class="app-main">
|
2022-04-22 01:16:02 +08:00
|
|
|
<router-view v-slot="{ Component }">
|
2022-04-21 18:20:39 +08:00
|
|
|
<transition name="fade-transform" mode="out-in">
|
|
|
|
<!-- <keep-alive> -->
|
|
|
|
<component :is="Component" :key="key" />
|
|
|
|
<!-- </keep-alive> -->
|
|
|
|
</transition>
|
|
|
|
</router-view>
|
|
|
|
</section>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
2022-04-22 01:16:02 +08:00
|
|
|
import { computed } from "vue"
|
|
|
|
import { useRoute } from "vue-router"
|
2022-04-21 18:20:39 +08:00
|
|
|
|
|
|
|
const route = useRoute()
|
|
|
|
const key = computed(() => {
|
|
|
|
return route.path
|
|
|
|
})
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.app-main {
|
|
|
|
/* 50 = navbar height */
|
|
|
|
min-height: calc(100vh - 50px);
|
|
|
|
width: 100%;
|
|
|
|
position: relative;
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
|
|
|
|
|
|
|
.fixed-header + .app-main {
|
|
|
|
padding-top: 50px;
|
|
|
|
height: 100vh;
|
|
|
|
overflow: auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
.hasTagsView {
|
|
|
|
.app-main {
|
|
|
|
/* 84 = navbar + tags-view = 50 + 34 */
|
|
|
|
min-height: calc(100vh - 84px);
|
|
|
|
}
|
|
|
|
.fixed-header + .app-main {
|
|
|
|
padding-top: 84px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|