Skip to content

Commit 70f2a94

Browse files
lin93h奇淼(piexlmax
andauthored
解决historyComponent无法删除问题 (flipped-aurora#1108)
* 修复historyComponent无法删除问题 Co-authored-by: 奇淼(piexlmax <qimiaojiangjizhao@gmail.com>
1 parent 63a26dc commit 70f2a94

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ const removeTab = (tab) => {
217217
const index = historys.value.findIndex(
218218
(item) => getFmtString(item) === tab
219219
)
220-
if (getFmtString(route) === tab) {
220+
if (getFmtString(route) === tab) {
221221
if (historys.value.length === 1) {
222222
router.push({ name: defaultRouter.value })
223223
} else {
@@ -261,6 +261,12 @@ watch(route, (to, now) => {
261261
activeValue.value = window.sessionStorage.getItem('activeValue')
262262
})
263263
264+
watch(() => historys.value, () => {
265+
sessionStorage.setItem('historys', JSON.stringify(historys.value))
266+
}, {
267+
deep: true
268+
})
269+
264270
const initPage = () => {
265271
// 全局监听 关闭当前页面函数
266272
emitter.on('closeThisPage', () => {

0 commit comments

Comments
 (0)