<template>
  <router-view>
    <template #default="{ Component, route }">
      <transition mode="out-in" appear>
        <keep-alive>
          <Component :is="Component" :key="route.fullPath" />
        </keep-alive>
      </transition>
    </template>
  </router-view>
</template>

<script lang="ts">
  import { defineComponent } from 'vue';

  import { getTransitionName } from './transition';

  export default defineComponent({
    name: 'PageLayout',

    setup() {
      return {
        getTransitionName,
      };
    },
  });
</script>
