// 全局音频背景播放状态管理模块 const audioJoinPlaylist = { namespaced: true, state: { playlist: [], }, mutations: { addPlaylist(state, payload) { state.playlist.length == 0 ? (state.playlist = [payload.dataList]) : state.playlist.push(payload.dataList); }, addUnshiftPlaylist(state, payload) { state.playlist.unshift(payload.dataList); }, //删除当前音频播放 removeAudio(state, payload) { state.playlist = payload.list; }, }, }; export default audioJoinPlaylist;