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