mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-10-30 12:57:10 +08:00
fix: 修复tab页只剩一个的时候无法关闭的问题
This commit is contained in:
@@ -79,7 +79,7 @@ watch(
|
|||||||
// 点击页签
|
// 点击页签
|
||||||
const handleTabClick = (key: string) => {
|
const handleTabClick = (key: string) => {
|
||||||
const obj = tabsStore.tabList.find((i) => i.path === key)
|
const obj = tabsStore.tabList.find((i) => i.path === key)
|
||||||
obj ? router.push(obj.fullPath) : router.push(key)
|
obj ? router.push(obj.fullPath || obj.path) : router.push(key)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,8 @@ const storeSetup = () => {
|
|||||||
const isActive = router.currentRoute.value.path === tabList.value[index].path
|
const isActive = router.currentRoute.value.path === tabList.value[index].path
|
||||||
tabList.value.splice(index, 1)
|
tabList.value.splice(index, 1)
|
||||||
if (isActive) {
|
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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user