mirror of
https://github.com/fugary/simple-element-plus-template.git
synced 2026-02-23 06:37:01 +00:00
tabs优化
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user