feat(router): Add dynamic routing

This commit is contained in:
陈凯龙
2022-01-11 10:47:10 +08:00
parent 95a2bd884d
commit b218ccc9cc
15 changed files with 478 additions and 323 deletions

View File

@@ -1,9 +1,16 @@
<script setup lang="ts"></script>
<script setup lang="ts">
// import { computed } from 'vue'
// const getCaches = computed((): string[] => {
// return []
// })
</script>
<template>
<section>
<router-view v-slot="{ Component, route }">
<component :is="Component" :key="route.fullPath" />
</router-view>
</section>
<RouterView>
<template #default="{ Component, route }">
<KeepAlive>
<Component :is="Component" :key="route.fullPath" />
</KeepAlive>
</template>
</RouterView>
</template>