存储本地

This commit is contained in:
2023-09-30 18:45:19 +08:00
parent 75eabfbf7a
commit 040dad3795
2 changed files with 8 additions and 0 deletions

View File

@ -54,6 +54,10 @@
//store.put(item) // 只有在like时才保存到本地
})
})
musicList.on('add', item => {
console.log('添加音乐', item)
store.put(item)
})
// 初始化客户端列表
const clientList = new ClientList({})

View File

@ -83,6 +83,10 @@ export default class MusicList {
})
]
}))
// 执行回调函数
if (this.EventListeners['add']) {
this.EventListeners['add'](item)
}
}
remove(item) {
this.ul.removeChild(this.ul.querySelector(`#${item.id}`))