fix: 修复页签路由切换页面未更新
- 拆分页签分组与页面渲染身份,确保列表和详情正确切换 - 让禁用缓存的路由绕过 KeepAlive,并补充资源切换回归测试
This commit is contained in:
@@ -9,9 +9,10 @@ import { computed } from 'vue';
|
||||
import { RouterView } from 'vue-router';
|
||||
|
||||
import { preferences, usePreferences } from '@easyflow/preferences';
|
||||
import { getTabKey, storeToRefs, useTabbarStore } from '@easyflow/stores';
|
||||
import { storeToRefs, useTabbarStore } from '@easyflow/stores';
|
||||
|
||||
import { IFrameRouterView } from '../../iframe';
|
||||
import { getRouteViewKey, shouldUseKeepAlive } from './route-view';
|
||||
|
||||
defineOptions({ name: 'LayoutContent' });
|
||||
|
||||
@@ -106,7 +107,7 @@ function transformComponent(
|
||||
appear
|
||||
>
|
||||
<KeepAlive
|
||||
v-if="keepAlive"
|
||||
v-if="shouldUseKeepAlive(route, keepAlive)"
|
||||
:exclude="getExcludeCachedTabs"
|
||||
:include="getCachedTabs"
|
||||
>
|
||||
@@ -114,18 +115,18 @@ function transformComponent(
|
||||
:is="transformComponent(Component, route)"
|
||||
v-if="renderRouteView"
|
||||
v-show="!route.meta.iframeSrc"
|
||||
:key="getTabKey(route)"
|
||||
:key="getRouteViewKey(route)"
|
||||
/>
|
||||
</KeepAlive>
|
||||
<component
|
||||
:is="Component"
|
||||
v-else-if="renderRouteView"
|
||||
:key="getTabKey(route)"
|
||||
:key="getRouteViewKey(route)"
|
||||
/>
|
||||
</Transition>
|
||||
<template v-else>
|
||||
<KeepAlive
|
||||
v-if="keepAlive"
|
||||
v-if="shouldUseKeepAlive(route, keepAlive)"
|
||||
:exclude="getExcludeCachedTabs"
|
||||
:include="getCachedTabs"
|
||||
>
|
||||
@@ -133,13 +134,13 @@ function transformComponent(
|
||||
:is="transformComponent(Component, route)"
|
||||
v-if="renderRouteView"
|
||||
v-show="!route.meta.iframeSrc"
|
||||
:key="getTabKey(route)"
|
||||
:key="getRouteViewKey(route)"
|
||||
/>
|
||||
</KeepAlive>
|
||||
<component
|
||||
:is="Component"
|
||||
v-else-if="renderRouteView"
|
||||
:key="getTabKey(route)"
|
||||
:key="getRouteViewKey(route)"
|
||||
/>
|
||||
</template>
|
||||
</RouterView>
|
||||
|
||||
Reference in New Issue
Block a user