页签历史驻留,返回关闭功能完成

This commit is contained in:
aixianling
2023-01-30 14:41:19 +08:00
parent 1abd4c49b0
commit 18af0281b1
5 changed files with 153 additions and 62 deletions

View File

@@ -234,13 +234,29 @@ export const wxwork = {
*/
export const logs = {
state: () => ({
closeIntro: []
closeIntro: [], pages: []
}),
mutations: {
addCloseIntro(state, app) {
state.closeIntro.push(app)
}
},
addPage(state, page) {
const id = location.href?.replace(location.origin, "")
if (!state.pages.find(e => e.id == id || e.id == page.id)) {
state.pages.push({...page, id})
}
},
deletePage(state, id) {
id = id || location.href?.replace(location.origin, "")
const i = state.pages.findIndex(e => e.id == id)
i > -1 && state.pages.splice(i, 1)
},
},
actions: {
closePage({commit}, id) {
return commit("deletePage", id)
}
}
}
/**
* 流程信息