如何在模块vuex js存储中设置全局突变

我需要能够alert从任何Vuex模块更改全局变量的状态

store / index.js

export const state = () => ({
    alert: null 
})

store / child.js

export const mutations = {
    SET_ALERT: function (rootState, alert) {
        rootState.alert = alert
    }
}
export const actions = {
    setalert({commit}){
        commit('SET_ALERT', 'warning')
    }
}

我想致电setalert并将全局设置store.state.alert"warning"目前,store.state.child.alert"warning"改为设置