From 70f2a94cc537192b5e25fce06a574ec4e854b06d Mon Sep 17 00:00:00 2001 From: lin93h <1098039601@qq.com> Date: Mon, 30 May 2022 21:44:45 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3historyComponent=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E5=88=A0=E9=99=A4=E9=97=AE=E9=A2=98=20(#1108)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 修复historyComponent无法删除问题 Co-authored-by: 奇淼(piexlmax --- web/src/view/layout/aside/historyComponent/history.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web/src/view/layout/aside/historyComponent/history.vue b/web/src/view/layout/aside/historyComponent/history.vue index 3d003fea..a026df20 100644 --- a/web/src/view/layout/aside/historyComponent/history.vue +++ b/web/src/view/layout/aside/historyComponent/history.vue @@ -217,7 +217,7 @@ const removeTab = (tab) => { const index = historys.value.findIndex( (item) => getFmtString(item) === tab ) - if (getFmtString(route) === tab) { + if (getFmtString(route) === tab) { if (historys.value.length === 1) { router.push({ name: defaultRouter.value }) } else { @@ -261,6 +261,12 @@ watch(route, (to, now) => { activeValue.value = window.sessionStorage.getItem('activeValue') }) +watch(() => historys.value, () => { + sessionStorage.setItem('historys', JSON.stringify(historys.value)) +}, { + deep: true +}) + const initPage = () => { // 全局监听 关闭当前页面函数 emitter.on('closeThisPage', () => { -- GitLab