<template>
  <div id="app" class="flex flex-center">
    <router-view v-slot="{ Component, route }">
      <keep-alive :include="keepAlive.list">
        <component :is="Component" :key="route.fullPath" />
      </keep-alive>
    </router-view>
  </div>
</template>

<script>
// This starter template is using Vue 3 <script setup> SFCs
// Check out https://vuejs.org/api/sfc-script-setup.html#script-setup

import keepAliveStore from '@/store/keepAlive.js'

export default {
  setup() {
    const keepAlive = keepAliveStore()
    return { keepAlive }
  },
  data() {
    return {
      data: '',
      type: '33'
    }
  },
  created() {
    console.info(
      '%c由%c梧桐研究院%c提供技术支持,版本号: v1.0.0',
      'font-size: 14px; margin-bottom: 2px; padding: 6px 8px; color: #fff; background: #707070;',
      'font-size: 14px; margin-bottom: 2px; padding: 6px 8px; color: #fff; background: orange;',
      'font-size: 14px; margin-bottom: 2px; padding: 6px 8px; color: #fff; background: #707070;'
    )
  },
  mounted() {
    window.addEventListener('scroll', this.menu)
  },
  methods: {
    menu() {
      const scroll =
        document.documentElement.scrollTop || document.body.scrollTop
      this.$bus.emit('scorll', scroll)
    }
  }
}
</script>

<style scoped>
#app {
  background-color: #f6f7f8;
}
</style>
