更优雅的变更页签标题

This commit is contained in:
aixianling
2023-03-01 10:14:41 +08:00
parent a10971e126
commit 8ce27cbc55

View File

@@ -257,6 +257,14 @@ export const logs = {
clearOtherPages(state) {
const id = location.href?.replace(location.origin, "")
state.pages = state.pages.filter(e => e.id == id) || []
},
setPageTitle(state, title) {
const id = location.href?.replace(location.origin, "")
state.pages.map(e => {
if (e.id == id) {
e.label = title
}
})
}
},
actions: {