<!--
 * @Author: 文贝
 * @Date: 2021-12-20 18:51:44
 * @LastEditors: 文贝
 * @LastEditTime: 2022-04-16 15:18:10
 * @Description:
 * @FilePath: \src\App.vue
-->
<template>
  <div id="app">
    <keep-alive :include="cachedViews">
      <router-view :key="key" />
    </keep-alive>
  </div>
</template>
<script>
export default {
  name: 'App',
  data() {
    return {}
  },
  computed: {
    cachedViews() {
      return this.$store.state.app.cachedViews
    },
    key() {
      return this.$route.path
    }
  },
  watch: {
    $route() {
      this.$store.dispatch('app/addCachedView', this.$route)
    }
  },
  mounted() {},
  methods: {}
}
</script>
<style>
html,
body,
#app {
  margin: 0px;
  padding: 0px;
  height: 100%;
  background: #f5f6f8;
  overflow: hidden;
}
</style>
