This repository was archived by the owner on May 11, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-11
lines changed
src/components/parts-playlist Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -76,10 +76,7 @@ export default {
7676 methods: {
7777 deleteAllSongs () {
7878 this .deleteAllSongsFromList ()
79-
80- if (! this .playlist .length ) {
81- this .closePlaylist ()
82- }
79+ this .closePlaylist ()
8380 },
8481
8582 deleteSong (song , index ) {
@@ -92,13 +89,10 @@ export default {
9289 },
9390
9491 scrollToCurrentSong (current ) {
95- const index = this .sequenceList .findIndex (item => {
96- return current .id === item .id
97- })
98-
99- this .$nextTick (() => { // 防止第一次点击时,$refs.playlistItem 为 undefined
100- this .$refs .contentScroll .scrollToElement (this .$refs .playlistItem [index], 300 )
92+ const index = this .sequenceList .findIndex ((song ) => {
93+ return song .id === current .id
10194 })
95+ this .$refs .contentScroll .scrollToElement (this .$refs .playlistItem [index], 300 )
10296 },
10397
10498 getCurrentIcon (item ) {
@@ -145,7 +139,7 @@ export default {
145139
146140 watch: {
147141 currentSong (newSong , oldSong ) {
148- if (! this .showPlaylist || newSong .id === oldSong .id ) {
142+ if (! this .hasShowPlaylist || newSong .id === oldSong .id ) {
149143 return
150144 }
151145
You can’t perform that action at this time.
0 commit comments