Commit 7d8b8db256f78b228b2b4629a472834a4cce9bd4
1 parent
7156e47c
fix(transition): fix transition not work close #334
Showing
2 changed files
with
6 additions
and
1 deletions
CHANGELOG.zh_CN.md
src/layouts/page/transition.ts
@@ -18,12 +18,16 @@ export function getTransitionName({ | @@ -18,12 +18,16 @@ export function getTransitionName({ | ||
18 | def: string; | 18 | def: string; |
19 | cacheTabs: string[]; | 19 | cacheTabs: string[]; |
20 | }) { | 20 | }) { |
21 | + if (!enableTransition) { | ||
22 | + return null; | ||
23 | + } | ||
24 | + | ||
21 | const isInCache = cacheTabs.includes(route.name as string); | 25 | const isInCache = cacheTabs.includes(route.name as string); |
22 | const transitionName = 'fade-slide'; | 26 | const transitionName = 'fade-slide'; |
23 | let name: string | null = transitionName; | 27 | let name: string | null = transitionName; |
24 | 28 | ||
25 | if (openCache) { | 29 | if (openCache) { |
26 | - name = isInCache && route.meta.loaded && enableTransition ? transitionName : null; | 30 | + name = isInCache && route.meta.loaded ? transitionName : null; |
27 | } | 31 | } |
28 | return name || route.meta.transitionName || def; | 32 | return name || route.meta.transitionName || def; |
29 | } | 33 | } |