fix: 修复tab页只剩一个的时候无法关闭的问题

This commit is contained in:
2024-09-28 23:07:25 +08:00
parent 0acd4829c5
commit 0594ae91c7
2 changed files with 3 additions and 2 deletions

View File

@@ -28,7 +28,8 @@ const storeSetup = () => {
const isActive = router.currentRoute.value.path === tabList.value[index].path
tabList.value.splice(index, 1)
if (isActive) {
router.push(tabList.value[tabList.value.length - 1].fullPath)
const lastObj = tabList.value[tabList.value.length - 1]
router.push(lastObj.fullPath || lastObj.path)
}
}