import { createStore } from 'vuex'; export interface State { name:string } export const key = Symbol(); export const store = createStore({ state() { return { name:'Vuex' }; }, getters: { GetName(state) { return state.name }, }, mutations: { ChangeName(state,payload){ state = payload } }, actions: { ACTION_NAME({ commit }, val) { commit('ChangeName', val); }, }, modules: {}, });