Skip to content

Commit 7d8b8db

Browse files
committed
fix(transition): fix transition not work close #334
1 parent 7156e47 commit 7d8b8db

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.zh_CN.md

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
### 🐛 Bug Fixes
88

99
- 确保 `table action` 的值被正确更新
10+
- 修复页面切换的动画无法关闭
1011

1112
## 2.0.3 (2021-03-07)
1213

src/layouts/page/transition.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,16 @@ export function getTransitionName({
1818
def: string;
1919
cacheTabs: string[];
2020
}) {
21+
if (!enableTransition) {
22+
return null;
23+
}
24+
2125
const isInCache = cacheTabs.includes(route.name as string);
2226
const transitionName = 'fade-slide';
2327
let name: string | null = transitionName;
2428

2529
if (openCache) {
26-
name = isInCache && route.meta.loaded && enableTransition ? transitionName : null;
30+
name = isInCache && route.meta.loaded ? transitionName : null;
2731
}
2832
return name || route.meta.transitionName || def;
2933
}

0 commit comments

Comments
 (0)