Skip to content

Commit

Permalink
fix(transition): fix transition not work close #334
Browse files Browse the repository at this point in the history
  • Loading branch information
anncwb committed Mar 8, 2021
1 parent 7156e47 commit 7d8b8db
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
### 🐛 Bug Fixes

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

## 2.0.3 (2021-03-07)

Expand Down
6 changes: 5 additions & 1 deletion src/layouts/page/transition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,16 @@ export function getTransitionName({
def: string;
cacheTabs: string[];
}) {
if (!enableTransition) {
return null;
}

const isInCache = cacheTabs.includes(route.name as string);
const transitionName = 'fade-slide';
let name: string | null = transitionName;

if (openCache) {
name = isInCache && route.meta.loaded && enableTransition ? transitionName : null;
name = isInCache && route.meta.loaded ? transitionName : null;
}
return name || route.meta.transitionName || def;
}

0 comments on commit 7d8b8db

Please sign in to comment.