优化我的列表、下载、歌单、排行榜列表性能

This commit is contained in:
lyswhut
2021-10-26 14:44:15 +08:00
parent 0d20869337
commit 35ca6db1ee
18 changed files with 646 additions and 335 deletions
+5 -3
View File
@@ -1,6 +1,7 @@
import musicSdk from '../../utils/music'
import { clearLyric, clearMusicUrl } from '../../utils'
import { sync as eventSyncName } from '@renderer/event/names'
import { removeListPosition, setListPrevSelectId } from '@renderer/utils/data'
let allList = {}
window.allList = allList
@@ -340,6 +341,7 @@ const mutations = {
if (index < 0) return
let list = state.userList.splice(index, 1)[0]
allListRemove(list)
removeListPosition(id)
},
setUserListName(state, { id, name, isSync }) {
if (!isSync) {
@@ -380,9 +382,6 @@ const mutations = {
state.userList.splice(index, 1)
state.userList.splice(index + 1, 0, targetList)
},
setListScroll(state, { id, location }) {
if (allList[id]) allList[id].location = location
},
setMusicPosition(state, { id, position, list, isSync }) {
if (!isSync) {
window.eventHub.$emit(eventSyncName.send_action_list, {
@@ -418,6 +417,9 @@ const mutations = {
setOtherSource(state, { musicInfo, otherSource }) {
musicInfo.otherSource = otherSource
},
setPrevSelectListId(state, val) {
setListPrevSelectId(val)
},
}
export default {