mirror of
https://github.com/Tencent/tdesign-vue-next-starter.git
synced 2024-12-23 04:36:31 +08:00
Merge branch 'develop' of github.com:Tencent/tdesign-vue-next-starter into main
This commit is contained in:
commit
bff024568b
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue
Block a user