Skip to content

Commit 33abe23

Browse files
authored
fix: closeTab
fix: closeTab
2 parents 90e7149 + fbe1963 commit 33abe23

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.changeset/famous-pets-raise.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@alita/plugins': patch
3+
---
4+
5+
fixed: closeTab 将在导航到页面之前添加 hash 和 search

packages/plugins/templates/keepalive/context.tpl

+2-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,8 @@ export function useKeepOutlets() {
194194
// 1.如果当前tab是第一个时自动选中后一个
195195
// 2.不是第一个时自动选中前一个
196196
const i = pathList.indexOf(targetKey?.toLowerCase())
197-
navigate(pathList[i === 0 ? i + 1 : i - 1])
197+
const {pathname, hash, search } = keepElements.current[pathList[i === 0 ? i + 1 : i - 1]?.toLowerCase()].location;
198+
navigate(`${pathname}${search}${hash}`);
198199
}
199200
};
200201
const navigate = useNavigate();

0 commit comments

Comments
 (0)