Skip to content

Commit 3e1067f

Browse files
mengtiantangxdefei
andauthored
web/src/view/layout/aside/historyComponent: fix 浏览器自带返回按钮点击多次才能返回上一页, 多次往路由栈push当前页面路由记录的bug (#1311)
Co-authored-by: xdefei <[email protected]>
1 parent 722382f commit 3e1067f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

web/src/view/layout/aside/historyComponent/history.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
:closable="!(historys.length === 1 && $route.name === defaultRouter)"
66
type="card"
77
@contextmenu.prevent="openContextMenu($event)"
8-
@tab-change="changeTab"
8+
@tab-click="changeTab"
99
@tab-remove="removeTab"
1010
>
1111
<el-tab-pane
@@ -209,7 +209,9 @@ const setTab = (route) => {
209209
210210
const historyMap = ref({})
211211
212-
const changeTab = (name) => {
212+
const changeTab = (TabsPaneContext) => {
213+
const name = TabsPaneContext?.props?.name
214+
if (!name) return
213215
const tab = historyMap.value[name]
214216
router.push({
215217
name: tab.name,

0 commit comments

Comments
 (0)