<template>
  <div class="app-container">
    <router-view v-slot="{ Component }">
      <transition name="fade" mode="out-in">
        <component :is="Component" />
      </transition>
    </router-view>
    <Tabbar v-if="showTabbar" />
  </div>
</template>

<script setup lang="ts">
import { computed } from 'vue'
import { useRoute } from 'vue-router'
import Tabbar from '@/components/Tabbar.vue'

const route = useRoute()

const showTabbar = computed(() => {
  return route.path !== '/login'
})
</script>

<style>
body {
  margin: 0;
  padding: 0;
  background: var(--mac-bg);
  background-attachment: fixed;
}

.app-container {
  min-height: 100vh;
}

/* 页面切换动画 */
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.2s ease;
}

.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}
</style>
