esc关闭下载弹窗页
parent
550917bd16
commit
ddd850d80f
|
@ -49,6 +49,14 @@ export default {
|
|||
return this.info.meta?.qualitys?.filter(quality => this.checkSource(quality.type)) || []
|
||||
},
|
||||
},
|
||||
|
||||
beforeUnmount() {
|
||||
document.removeEventListener('keyup', this.handleEscKey)
|
||||
},
|
||||
mounted() {
|
||||
document.addEventListener('keyup', this.handleEscKey)
|
||||
},
|
||||
|
||||
methods: {
|
||||
handleClick(quality) {
|
||||
void createDownloadTasks([this.musicInfo], quality)
|
||||
|
@ -57,6 +65,11 @@ export default {
|
|||
handleClose() {
|
||||
this.$emit('update:show', false)
|
||||
},
|
||||
handleEscKey(event) {
|
||||
if (event.key === 'Escape') {
|
||||
this.handleClose()
|
||||
}
|
||||
},
|
||||
getTypeName(quality) {
|
||||
switch (quality) {
|
||||
case 'flac24bit':
|
||||
|
|
Loading…
Reference in New Issue