import { RootState } from "../index"
import { ActionContext } from "vuex"
//定义state类型
export type SocketState = {
    data:string;
}
//定义state
export const state:SocketState = {
    data:''
}
//定义mutations
export const mutations = {
    setData(state:SocketState,data:string){
        state.data = data
        localStorage.setItem('socketData',data)
    }
}
//定义actions
export const actions = {
}
//定义getters
export const getters = {
    getData(state:SocketState){
        return state.data
    }
}
export default {
    namespaced: true,
    state,
    mutations,
    actions,
    getters
}