更新0.1.1版本

This commit is contained in:
Ah jung
2021-07-07 10:26:14 +08:00
parent b74b6e61a4
commit d423f27e94
174 changed files with 15966 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
import MainView from './index.vue'
export { MainView }

View File

@@ -0,0 +1,43 @@
<template>
<RouterView>
<template #default="{ Component, route }">
<transition name="zoom-fade" mode="out-in" appear>
<keep-alive v-if="keepAliveComponents" :include="keepAliveComponents">
<component :is="Component" :key="route.fullPath"/>
</keep-alive>
<component v-else :is="Component" :key="route.fullPath"/>
</transition>
</template>
</RouterView>
</template>
<script>
import { defineComponent, computed } from 'vue'
import { useAsyncRouteStore } from '@/store/modules/asyncRoute'
export default defineComponent({
name: 'MainView',
components: {},
props: {
notNeedKey: {
type: Boolean,
default: false
},
animate: {
type: Boolean,
default: true
}
},
setup() {
const asyncRouteStore = useAsyncRouteStore()
// 需要缓存的路由组件
const keepAliveComponents = computed(() => asyncRouteStore.keepAliveComponents)
return {
keepAliveComponents
}
}
})
</script>
<style lang="less" scoped>
</style>