加载新列表时清空当前列表
This commit is contained in:
@@ -39,6 +39,7 @@ const actions = {
|
||||
let tabId = rootState.setting.leaderboard.tabId
|
||||
let key = `${source}${tabId}${page}}`
|
||||
if (state.list.length && state.key == key) return true
|
||||
commit('clearList')
|
||||
return music[source].leaderboard.getList(tabId, page).then(result => commit('setList', { result, key }))
|
||||
},
|
||||
}
|
||||
@@ -52,6 +53,10 @@ const mutations = {
|
||||
state.page = result.page
|
||||
state.key = key
|
||||
},
|
||||
clearList(state) {
|
||||
state.list = []
|
||||
state.total = 0
|
||||
},
|
||||
}
|
||||
|
||||
export default {
|
||||
|
||||
Reference in New Issue
Block a user