mirror of
https://github.com/fantastic-admin/basic.git
synced 2026-10-07 00:23:43 +08:00
refactor: 调整标签页关闭逻辑,优先跳转至前一个标签页
This commit is contained in:
@@ -25,11 +25,11 @@ export default function useTabbar() {
|
||||
// 如果关闭的标签正好是当前路由
|
||||
if (tabId === activedTabId) {
|
||||
const index = tabbarStore.list.findIndex(item => item.tabId === tabId)
|
||||
if (index < tabbarStore.list.length - 1) {
|
||||
close(tabbarStore.list[index + 1].fullPath)
|
||||
if (index > 0) {
|
||||
close(tabbarStore.list[index - 1].fullPath)
|
||||
}
|
||||
else {
|
||||
close(tabbarStore.list[index - 1].fullPath)
|
||||
close(tabbarStore.list[index + 1].fullPath)
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user