未验证 提交 70f2a94c 编写于 作者: L lin93h 提交者: GitHub

解决historyComponent无法删除问题 (#1108)

* 修复historyComponent无法删除问题
Co-authored-by: N奇淼(piexlmax <qimiaojiangjizhao@gmail.com>
上级 63a26dcd
......@@ -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', () => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册