Skip to content

Commit 5412e35

Browse files
committed
调整标签页关闭逻辑,优先跳转至前一个标签页
1 parent e05ae82 commit 5412e35

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/utils/composables/useTabbar.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ export default function useTabbar() {
2525
// 如果关闭的标签正好是当前路由
2626
if (tabId === activedTabId) {
2727
const index = tabbarStore.list.findIndex(item => item.tabId === tabId)
28-
if (index < tabbarStore.list.length - 1) {
29-
close(tabbarStore.list[index + 1].fullPath)
28+
if (index > 0) {
29+
close(tabbarStore.list[index - 1].fullPath)
3030
}
3131
else {
32-
close(tabbarStore.list[index - 1].fullPath)
32+
close(tabbarStore.list[index + 1].fullPath)
3333
}
3434
}
3535
else {

0 commit comments

Comments
 (0)