新增添加歌曲到“我的列表”时,若按住ctrl键,则不会自动关闭添加窗口
This commit is contained in:
@@ -21,6 +21,7 @@ import { mapMutations } from 'vuex'
|
||||
import { computed } from '@renderer/utils/vueTools'
|
||||
import { defaultList, loveList, userLists } from '@renderer/core/share/list'
|
||||
import { getList } from '@renderer/core/share/utils'
|
||||
import useKeyDown from '@renderer/utils/compositions/useKeyDown'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
@@ -57,6 +58,8 @@ export default {
|
||||
},
|
||||
emits: ['update:show'],
|
||||
setup(props) {
|
||||
const keyModDown = useKeyDown('mod')
|
||||
|
||||
const lists = computed(() => {
|
||||
if (!props.musicInfo) return []
|
||||
const targetMid = props.musicInfo.songmid
|
||||
@@ -67,6 +70,7 @@ export default {
|
||||
].filter(l => !props.excludeListId.includes(l.id)).map(l => ({ ...l, isExist: getList(l.id).some(s => s.songmid == targetMid) }))
|
||||
})
|
||||
return {
|
||||
keyModDown,
|
||||
lists,
|
||||
}
|
||||
},
|
||||
@@ -103,6 +107,8 @@ export default {
|
||||
this.isMove
|
||||
? this.listMove({ fromId: this.fromListId, toId: this.lists[index].id, musicInfo: this.musicInfo })
|
||||
: this.listAdd({ id: this.lists[index].id, musicInfo: this.musicInfo })
|
||||
|
||||
if (this.keyModDown && !this.isMove) return
|
||||
this.$nextTick(() => {
|
||||
this.handleClose()
|
||||
})
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
import { mapMutations } from 'vuex'
|
||||
import { computed } from '@renderer/utils/vueTools'
|
||||
import { defaultList, loveList, userLists } from '@renderer/core/share/list'
|
||||
import useKeyDown from '@renderer/utils/compositions/useKeyDown'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
@@ -59,6 +60,8 @@ export default {
|
||||
},
|
||||
emits: ['update:show', 'confirm'],
|
||||
setup(props) {
|
||||
const keyModDown = useKeyDown('mod')
|
||||
|
||||
const lists = computed(() => {
|
||||
return [
|
||||
defaultList,
|
||||
@@ -67,6 +70,7 @@ export default {
|
||||
].filter(l => !props.excludeListId.includes(l.id))
|
||||
})
|
||||
return {
|
||||
keyModDown,
|
||||
lists,
|
||||
}
|
||||
},
|
||||
@@ -104,6 +108,8 @@ export default {
|
||||
this.isMove
|
||||
? this.listMoveMultiple({ fromId: this.fromListId, toId: this.lists[index].id, list: this.musicList })
|
||||
: this.listAddMultiple({ id: this.lists[index].id, list: this.musicList })
|
||||
|
||||
if (this.keyModDown && !this.isMove) return
|
||||
this.$nextTick(() => {
|
||||
this.handleClose()
|
||||
this.$emit('confirm')
|
||||
|
||||
Reference in New Issue
Block a user