<template>
  <div :class="{ 'p-16px': showPadding }"
    class="h-full bg-[#f1f5fc] dark:bg-[#101014] transition duration-200 ease-in-out overflow-y-scroll">
    <router-view v-slot="{ Component, route }">
      <transition :name="theme.page.animate ? theme.page.animateMode : undefined" mode="out-in" appear>
        <keep-alive :include="routeStore.cacheRoutes">
          <component :is="Component" v-if="app.reloadFlag" :key="route.path" />
        </keep-alive>
      </transition>
    </router-view>
  </div>
</template>

<script setup lang="ts">
import { useAppStore, useThemeStore, useRouteStore } from '@/store';

interface Props {
  /** 显示padding */
  showPadding?: boolean;
}

withDefaults(defineProps<Props>(), {
  showPadding: true
});

const app = useAppStore();
const theme = useThemeStore();
const routeStore = useRouteStore();
</script>
<style scoped></style>
