App.vue 665 B

123456789101112131415161718192021222324252627282930
  1. <template>
  2. <div id="app-root">
  3. <router-view v-slot="{ Component }">
  4. <transition name="fade" mode="out-in">
  5. <component :is="Component" />
  6. </transition>
  7. </router-view>
  8. <bottom-nav v-if="showNav" />
  9. </div>
  10. </template>
  11. <script setup lang="ts">
  12. import { computed } from 'vue'
  13. import { useRoute } from 'vue-router'
  14. import BottomNav from './components/BottomNav.vue'
  15. const route = useRoute()
  16. const showNav = computed(() => !['login', 'make-wish'].includes(route.name as string))
  17. </script>
  18. <style>
  19. .fade-enter-active,
  20. .fade-leave-active {
  21. transition: opacity 0.2s ease;
  22. }
  23. .fade-enter-from,
  24. .fade-leave-to {
  25. opacity: 0;
  26. }
  27. </style>