Commit 7d8b8db256f78b228b2b4629a472834a4cce9bd4

Authored by Vben
1 parent 7156e47c

fix(transition): fix transition not work close #334

CHANGELOG.zh_CN.md
@@ -7,6 +7,7 @@ @@ -7,6 +7,7 @@
7 ### 🐛 Bug Fixes 7 ### 🐛 Bug Fixes
8 8
9 - 确保 `table action` 的值被正确更新 9 - 确保 `table action` 的值被正确更新
  10 +- 修复页面切换的动画无法关闭
10 11
11 ## 2.0.3 (2021-03-07) 12 ## 2.0.3 (2021-03-07)
12 13
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 }