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 7 ### 🐛 Bug Fixes
8 8  
9 9 - 确保 `table action` 的值被正确更新
  10 +- 修复页面切换的动画无法关闭
10 11  
11 12 ## 2.0.3 (2021-03-07)
12 13  
... ...
src/layouts/page/transition.ts
... ... @@ -18,12 +18,16 @@ export function getTransitionName({
18 18 def: string;
19 19 cacheTabs: string[];
20 20 }) {
  21 + if (!enableTransition) {
  22 + return null;
  23 + }
  24 +
21 25 const isInCache = cacheTabs.includes(route.name as string);
22 26 const transitionName = 'fade-slide';
23 27 let name: string | null = transitionName;
24 28  
25 29 if (openCache) {
26   - name = isInCache && route.meta.loaded && enableTransition ? transitionName : null;
  30 + name = isInCache && route.meta.loaded ? transitionName : null;
27 31 }
28 32 return name || route.meta.transitionName || def;
29 33 }
... ...