This commit is contained in:
2021-09-16 15:56:59 +08:00
commit d9ea8630df
29 changed files with 9807 additions and 0 deletions

27
src/App.vue Normal file
View File

@@ -0,0 +1,27 @@
<template>
<router-view v-slot="{ Component }">
<keep-alive :include="includeList">
<component :is="Component"></component>
</keep-alive>
</router-view>
</template>
<script lang="ts" setup>
import { ref, watch } from 'vue'
import { RouteLocationNormalizedLoaded, useRoute } from 'vue-router'
const includeList = ref<string[]>([])
const route = useRoute()
watch(route, (to: RouteLocationNormalizedLoaded) => {
if (to.meta?.keepAlive && includeList.value.indexOf(to.name as string) === -1) {
includeList.value.push(to.name as string)
}
})
</script>
<style lang="less">
body {
background: #f7f8fa;
}
</style>