新增“双击列表里的歌曲时自动切换到当前列表播放”设置

This commit is contained in:
lyswhut
2022-02-10 12:48:01 +08:00
parent 748a420b64
commit 8e5b144f00
10 changed files with 35 additions and 14 deletions
+11 -3
View File
@@ -16,6 +16,7 @@
<material-online-list
ref="songList"
@show-menu="hideListsMenu"
@play-list="handlePlayList"
@toggle-page="handleGetList"
:rowWidth="{r1: '5%', r2: 'auto', r3: '22%', r4: '22%', r5: '9%', r6: '15%'}"
:page="page"
@@ -219,13 +220,13 @@ export default {
sourceListId: `board__${boardId}`,
})
},
async playSongListDetail({ boardId, id }) {
async playSongListDetail({ boardId, id, index = 0 }) {
let isPlayingList = false
const list = this.tabId == boardId ? [...this.list] : null
if (list?.length) {
this.setTempList({
list,
index: 0,
index,
id,
})
isPlayingList = true
@@ -242,11 +243,18 @@ export default {
} else {
this.setTempList({
list: fullList,
index: 0,
index,
id,
})
}
},
handlePlayList(index) {
this.playSongListDetail({
boardId: this.tabId,
id: `board__${this.source}__${this.tabId}`,
index,
})
},
},
}
</script>