audioPlaylist.js 547 B

12345678910111213141516171819202122
  1. // 全局音频背景播放状态管理模块
  2. const audioJoinPlaylist = {
  3. namespaced: true,
  4. state: {
  5. playlist: [],
  6. },
  7. mutations: {
  8. addPlaylist(state, payload) {
  9. state.playlist.length == 0 ? (state.playlist = [payload.dataList]) : state.playlist.push(payload.dataList);
  10. },
  11. addUnshiftPlaylist(state, payload) {
  12. state.playlist.unshift(payload.dataList);
  13. },
  14. //删除当前音频播放
  15. removeAudio(state, payload) {
  16. state.playlist = payload.list;
  17. },
  18. },
  19. };
  20. export default audioJoinPlaylist;