合并按钮

This commit is contained in:
2023-10-01 03:42:12 +08:00
parent cbbf007da1
commit f0544c3148
1 changed files with 17 additions and 9 deletions

View File

@ -89,14 +89,15 @@ export default class MusicList {
innerText: '播放', innerText: '播放',
onclick: event => { onclick: event => {
event.stopPropagation() event.stopPropagation()
if (event.target.dataset.play === 'play') {
event.target.dataset.play = 'stop'
event.target.innerText = '播放'
this.stop()
} else {
event.target.dataset.play = 'play'
event.target.innerText = '停止'
this.play(item) this.play(item)
} }
}),
Button({
innerText: '停止',
onclick: event => {
event.stopPropagation()
this.stop(item.id)
} }
}), }),
Button({ Button({
@ -117,7 +118,14 @@ export default class MusicList {
innerText: '禁止', innerText: '禁止',
onclick: event => { onclick: event => {
event.stopPropagation() event.stopPropagation()
// BAN if (event.target.dataset.ban === 'ban') {
event.target.dataset.ban = 'unban'
event.target.innerText = '禁止'
} else {
event.target.dataset.ban = 'ban'
event.target.innerText = '解禁'
this.stop()
}
} }
}) })
] ]