// src/store/index.js
import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    isPlaying: false, // 控制语音播放的全局状态
  },
  mutations: {
    setIsPlaying(state, value) {
      state.isPlaying = value;
    }
  },
  actions: {
    updateIsPlaying({ commit }, value) {
      commit('setIsPlaying', value);
    }
  },
  getters: {
    isPlaying: state => state.isPlaying
  },
  modules: {}
});