Skip to content

Commit

Permalink
web/src/view/layout/aside/historyComponent: fix 浏览器自带返回按钮点击多次才能返回上一页,…
Browse files Browse the repository at this point in the history
… 多次往路由栈push当前页面路由记录的bug (flipped-aurora#1311)

Co-authored-by: xdefei <13523376917@163.com>
  • Loading branch information
mengtiantang and xdefei committed Dec 14, 2022
1 parent 145ac9d commit 627b18b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions web/src/view/layout/aside/historyComponent/history.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
:closable="!(historys.length === 1 && $route.name === defaultRouter)"
type="card"
@contextmenu.prevent="openContextMenu($event)"
@tab-change="changeTab"
@tab-click="changeTab"
@tab-remove="removeTab"
>
<el-tab-pane
Expand Down Expand Up @@ -209,7 +209,9 @@ const setTab = (route) => {
const historyMap = ref({})
const changeTab = (name) => {
const changeTab = (TabsPaneContext) => {
const name = TabsPaneContext?.props?.name
if (!name) return
const tab = historyMap.value[name]
router.push({
name: tab.name,
Expand Down

0 comments on commit 627b18b

Please sign in to comment.