tabs优化

This commit is contained in:
Gary Fu
2023-12-30 14:07:49 +08:00
parent aeb759c5c0
commit d74c876d70
12 changed files with 210 additions and 39 deletions

View File

@@ -31,12 +31,22 @@ const selectHistoryTab = path => {
}
const removeHistoryTab = path => {
const lastTab = tabsViewStore.removeHistoryTab(path)
const lastTab = tabsViewStore.removeHistoryTab({ path })
if (lastTab) {
selectHistoryTab(lastTab)
}
}
const refreshHistoryTab = tab => {
const time = new Date().getTime()
router.push(`${tab.path}?${time}`)
}
const removeOtherHistoryTabs = tab => {
tabsViewStore.removeOtherHistoryTabs(tab)
selectHistoryTab(tab.path)
}
</script>
<template>
@@ -52,6 +62,9 @@ const removeHistoryTab = path => {
<tabs-view-item
v-for="item in tabsViewStore.historyTabs"
:key="item.path"
:refresh-history-tab="refreshHistoryTab"
:remove-history-tab="removeHistoryTab"
:remove-other-history-tabs="removeOtherHistoryTabs"
:tab-item="item"
/>
</el-tabs>