mirror of
https://github.com/Tencent/tdesign-vue-next-starter.git
synced 2024-12-23 14:06:32 +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 }">
|
<router-view v-if="!isRefreshing" v-slot="{ Component }">
|
||||||
<transition name="fade" mode="out-in">
|
<transition name="fade" mode="out-in">
|
||||||
<keep-alive :include="aliveViews">
|
<keep-alive :include="aliveViews">
|
||||||
<component :is="Component" :key="activeRouteFullPath" />
|
<component :is="Component" />
|
||||||
</keep-alive>
|
</keep-alive>
|
||||||
</transition>
|
</transition>
|
||||||
</router-view>
|
</router-view>
|
||||||
|
@ -10,13 +10,16 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, ComputedRef } from 'vue';
|
import { computed, ComputedRef } from 'vue';
|
||||||
import { useRouter } from 'vue-router';
|
|
||||||
import { useTabsRouterStore } from '@/store';
|
import { useTabsRouterStore } from '@/store';
|
||||||
|
|
||||||
const activeRouteFullPath = computed(() => {
|
// 如果存在需解决/page/1=> /page/2 刷新数据问题 请修改代码 使用activeRouteFullPath 作为key
|
||||||
const router = useRouter();
|
// <component :is="Component" :key="activeRouteFullPath" />
|
||||||
return router.currentRoute.value.fullPath;
|
|
||||||
});
|
// import { useRouter } from 'vue-router';
|
||||||
|
// const activeRouteFullPath = computed(() => {
|
||||||
|
// const router = useRouter();
|
||||||
|
// return router.currentRoute.value.fullPath;
|
||||||
|
// });
|
||||||
|
|
||||||
const aliveViews = computed(() => {
|
const aliveViews = computed(() => {
|
||||||
const tabsRouterStore = useTabsRouterStore();
|
const tabsRouterStore = useTabsRouterStore();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user