<template>
    <div class="layout-container">
        <!-- 头部导航 -->
        <app-header />

        <!-- 主内容区 -->
        <main class="layout-main">
            <router-view v-slot="{ Component }">
                <transition name="fade">
                    <component :is="Component" />
                </transition>
            </router-view>
        </main>

        <!-- 页脚 -->
        <app-footer />

        <!-- 回到顶部 -->
        <back-to-top />
    </div>
</template>

<script>
import { defineComponent } from 'vue';
import AppHeader from './layout/Header.vue';
import AppFooter from './layout/Footer.vue';
import Breadcrumb from './components/Breadcrumb.vue';
import BackToTop from './components/BackToTop.vue';

export default defineComponent({
    name: 'Layout',
    components: {
        AppHeader,
        AppFooter,
        Breadcrumb,
        BackToTop
    }
});
</script>

<style lang="scss" scoped>
@use '@/assets/styles/variables.scss' as vars;

.layout-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.layout-main {
    flex: 1;
    max-width: 1240px;
    margin: 0 auto;
    width: 100%;
}


// 页面切换动画
.slide-fade-enter-active {
    transition: all 0.15s ease-out;
}

.slide-fade-leave-active {
    transition: all 0.1s ease-in;
}

.slide-fade-enter-from {
    transform: translateX(10px);
    opacity: 0;
}

.slide-fade-leave-to {
    transform: translateX(-10px);
    opacity: 0;
}

</style>
