Merge branch 'develop' of github.com:Tencent/tdesign-vue-next-starter into main

This commit is contained in:
Uyarn 2022-08-11 15:54:13 +08:00
commit bff024568b

View File

@ -2,7 +2,7 @@
<router-view v-if="!isRefreshing" v-slot="{ Component }">
<transition name="fade" mode="out-in">
<keep-alive :include="aliveViews">
<component :is="Component" :key="activeRouteFullPath" />
<component :is="Component" />
</keep-alive>
</transition>
</router-view>
@ -10,13 +10,16 @@
<script setup lang="ts">
import { computed, ComputedRef } from 'vue';
import { useRouter } from 'vue-router';
import { useTabsRouterStore } from '@/store';
const activeRouteFullPath = computed(() => {
const router = useRouter();
return router.currentRoute.value.fullPath;
});
// /page/1=> /page/2 使activeRouteFullPath key
// <component :is="Component" :key="activeRouteFullPath" />
// import { useRouter } from 'vue-router';
// const activeRouteFullPath = computed(() => {
// const router = useRouter();
// return router.currentRoute.value.fullPath;
// });
const aliveViews = computed(() => {
const tabsRouterStore = useTabsRouterStore();