fix(frontend): 优化网页标题设置逻辑

- 添加 SET_TITLE mutation 用于直接设置标题
- 修改 setTitle action,通过 commit调用 SET_TITLE mutation

Signed-off-by: Zhu-meng <lian62978@outlook.com>
pull/1090/head
Zhu-meng 2025-09-08 10:47:43 +00:00 committed by Gitee
parent 41496b6d8a
commit 057b0c3908
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 4 additions and 1 deletions

View File

@ -23,6 +23,9 @@ const mutations = {
if (state.hasOwnProperty(key)) {
state[key] = value
}
},
SET_TITLE: (state, title) => {
state.title = title
}
}
@ -33,7 +36,7 @@ const actions = {
},
// 设置网页标题
setTitle({ commit }, title) {
state.title = title
commit('SET_TITLE', title)
useDynamicTitle()
}
}