Skip to content

Commit

Permalink
fix(iframe): iframe loads early when closing multi-tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
anncwb committed Dec 27, 2020
1 parent ac1a369 commit 73cee06
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
- 修复多语言配置 `Locale.show`导致配置不生效
- 修复路由类型错误
- 修复菜单分割时权限失效问题
- 关闭多标签页时 iframe 提前加载

## 2.0.0-rc.14 (2020-12-15)

Expand Down
2 changes: 1 addition & 1 deletion src/components/Application/src/search/useMenuSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export function useMenuSearch(refs: Ref<HTMLElement[]>, scrollWrap: Ref<ElRef>,
emit('close');
}

useKeyPress(['enter', 'up', 'down'], (events) => {
useKeyPress(['enter', 'up', 'down', 'esc'], (events) => {
const keyCode = events.keyCode;
switch (keyCode) {
case KeyCodeEnum.UP:
Expand Down
3 changes: 2 additions & 1 deletion src/layouts/iframe/useFrameKeepAlive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ export function useFrameKeepAlive() {

function hasRenderFrame(name: string) {
if (!unref(getShowMultipleTab)) {
return true;
return router.currentRoute.value.name === name;
}
return unref(getOpenTabList).includes(name);
}

return { hasRenderFrame, getFramePages, showIframe, getAllFramePages };
}

0 comments on commit 73cee06

Please sign in to comment.