fix(fe): resolve tab overflow eviction and router synchronization bugs when closing active tabs
This commit is contained in:
@@ -15,7 +15,17 @@ const handleTabClick = (path: string) => {
|
||||
|
||||
const handleCloseTab = (event: Event, tabId: string) => {
|
||||
event.stopPropagation()
|
||||
const wasActive = activeTabId.value === tabId
|
||||
layoutStore.closeTab(tabId)
|
||||
|
||||
if (wasActive) {
|
||||
const nextActiveTab = tabs.value.find(t => t.id === layoutStore.activeTabId)
|
||||
if (nextActiveTab) {
|
||||
router.push(nextActiveTab.path)
|
||||
} else {
|
||||
router.push('/home')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const handleCloseOther = (tabId: string) => {
|
||||
|
||||
Reference in New Issue
Block a user