Skip to content

Commit

Permalink
fix: closeTab
Browse files Browse the repository at this point in the history
fix: closeTab
  • Loading branch information
xiaohuoni authored Feb 28, 2024
2 parents 90e7149 + fbe1963 commit 33abe23
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/famous-pets-raise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@alita/plugins': patch
---

fixed: closeTab 将在导航到页面之前添加 hash 和 search
3 changes: 2 additions & 1 deletion packages/plugins/templates/keepalive/context.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ export function useKeepOutlets() {
// 1.如果当前tab是第一个时自动选中后一个
// 2.不是第一个时自动选中前一个
const i = pathList.indexOf(targetKey?.toLowerCase())
navigate(pathList[i === 0 ? i + 1 : i - 1])
const {pathname, hash, search } = keepElements.current[pathList[i === 0 ? i + 1 : i - 1]?.toLowerCase()].location;
navigate(`${pathname}${search}${hash}`);
}
};
const navigate = useNavigate();
Expand Down

0 comments on commit 33abe23

Please sign in to comment.