网页标题设置新增SET_TITLE方法

This commit is contained in:
RuoYi
2025-12-02 19:30:01 +08:00
parent 0cb12f5440
commit 352ed6eee7

View File

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