在歌单详情界面新增播放当前歌单按钮、收藏歌单按钮

This commit is contained in:
lyswhut
2020-08-22 14:06:16 +08:00
parent 8df3ff3536
commit 341df0dab7
11 changed files with 96 additions and 57 deletions
+18 -8
View File
@@ -28,6 +28,12 @@ const state = {
list: [],
location: 0,
},
tempList: {
id: 'temp',
name: '临时列表',
list: [],
location: 0,
},
userList: [],
}
@@ -140,15 +146,19 @@ const mutations = {
if (!targetList) return
Object.assign(targetList.list[index], data)
},
createUserList(state, name) {
let newList = {
name,
id: `userlist_${Date.now()}`,
list: [],
location: 0,
createUserList(state, { name, id = `userlist_${Date.now()}`, list = [] }) {
let newList = state.userList.find(item => item.id === id)
if (!newList) {
newList = {
name,
id,
list: [],
location: 0,
}
state.userList.push(newList)
allListUpdate(newList)
}
state.userList.push(newList)
allListUpdate(newList)
this.commit('list/listAddMultiple', { id, list })
},
removeUserList(state, index) {
let list = state.userList.splice(index, 1)[0]