修改绑定的键

This commit is contained in:
lyswhut
2020-04-27 11:29:23 +08:00
parent d54053003e
commit 031c0c263d
6 changed files with 47 additions and 47 deletions
+10 -10
View File
@@ -72,7 +72,7 @@ export default {
tabId: 'all',
keyEvent: {
isShiftDown: false,
isAltDown: false,
isModDown: false,
isADown: false,
},
}
@@ -132,16 +132,16 @@ export default {
listenEvent() {
window.eventHub.$on('shift_down', this.handle_shift_down)
window.eventHub.$on('shift_up', this.handle_shift_up)
window.eventHub.$on('alt_down', this.handle_alt_down)
window.eventHub.$on('alt_up', this.handle_alt_up)
window.eventHub.$on('mod_down', this.handle_mod_down)
window.eventHub.$on('mod_up', this.handle_mod_up)
window.eventHub.$on('mod+a_down', this.handle_mod_a_down)
window.eventHub.$on('mod+a_up', this.handle_mod_a_up)
},
unlistenEvent() {
window.eventHub.$off('shift_down', this.handle_shift_down)
window.eventHub.$off('shift_up', this.handle_shift_up)
window.eventHub.$off('alt_down', this.handle_alt_down)
window.eventHub.$off('alt_up', this.handle_alt_up)
window.eventHub.$off('mod_down', this.handle_mod_down)
window.eventHub.$off('mod_up', this.handle_mod_up)
window.eventHub.$off('mod+a_down', this.handle_mod_a_down)
window.eventHub.$off('mod+a_up', this.handle_mod_a_up)
},
@@ -151,11 +151,11 @@ export default {
handle_shift_up() {
if (this.keyEvent.isShiftDown) this.keyEvent.isShiftDown = false
},
handle_alt_down() {
if (!this.keyEvent.isAltDown) this.keyEvent.isAltDown = true
handle_mod_down() {
if (!this.keyEvent.isModDown) this.keyEvent.isModDown = true
},
handle_alt_up() {
if (this.keyEvent.isAltDown) this.keyEvent.isAltDown = false
handle_mod_up() {
if (this.keyEvent.isModDown) this.keyEvent.isModDown = false
},
handle_mod_a_down() {
if (!this.keyEvent.isADown) {
@@ -229,7 +229,7 @@ export default {
event.currentTarget.classList.add('active')
this.selectdData.push(this.showList[clickIndex])
}
} else if (this.keyEvent.isAltDown) {
} else if (this.keyEvent.isModDown) {
let item = this.showList[clickIndex]
let index = this.selectdData.indexOf(item)
if (index < 0) {
+10 -10
View File
@@ -70,7 +70,7 @@ export default {
isToggleList: true,
keyEvent: {
isShiftDown: false,
isAltDown: false,
isModDown: false,
isADown: false,
},
}
@@ -193,16 +193,16 @@ export default {
listenEvent() {
window.eventHub.$on('shift_down', this.handle_shift_down)
window.eventHub.$on('shift_up', this.handle_shift_up)
window.eventHub.$on('alt_down', this.handle_alt_down)
window.eventHub.$on('alt_up', this.handle_alt_up)
window.eventHub.$on('mod_down', this.handle_mod_down)
window.eventHub.$on('mod_up', this.handle_mod_up)
window.eventHub.$on('mod+a_down', this.handle_mod_a_down)
window.eventHub.$on('mod+a_up', this.handle_mod_a_up)
},
unlistenEvent() {
window.eventHub.$off('shift_down', this.handle_shift_down)
window.eventHub.$off('shift_up', this.handle_shift_up)
window.eventHub.$off('alt_down', this.handle_alt_down)
window.eventHub.$off('alt_up', this.handle_alt_up)
window.eventHub.$off('mod_down', this.handle_mod_down)
window.eventHub.$off('mod_up', this.handle_mod_up)
window.eventHub.$off('mod+a_down', this.handle_mod_a_down)
window.eventHub.$off('mod+a_up', this.handle_mod_a_up)
},
@@ -212,11 +212,11 @@ export default {
handle_shift_up() {
if (this.keyEvent.isShiftDown) this.keyEvent.isShiftDown = false
},
handle_alt_down() {
if (!this.keyEvent.isAltDown) this.keyEvent.isAltDown = true
handle_mod_down() {
if (!this.keyEvent.isModDown) this.keyEvent.isModDown = true
},
handle_alt_up() {
if (this.keyEvent.isAltDown) this.keyEvent.isAltDown = false
handle_mod_up() {
if (this.keyEvent.isModDown) this.keyEvent.isModDown = false
},
handle_mod_a_down() {
if (!this.keyEvent.isADown) {
@@ -311,7 +311,7 @@ export default {
event.currentTarget.classList.add('active')
this.selectdData.push(this.list[clickIndex])
}
} else if (this.keyEvent.isAltDown) {
} else if (this.keyEvent.isModDown) {
let item = this.list[clickIndex]
let index = this.selectdData.indexOf(item)
if (index < 0) {
+10 -10
View File
@@ -80,7 +80,7 @@ export default {
isShowListAddMultiple: false,
keyEvent: {
isShiftDown: false,
isAltDown: false,
isModDown: false,
isADown: false,
},
}
@@ -171,16 +171,16 @@ export default {
listenEvent() {
window.eventHub.$on('shift_down', this.handle_shift_down)
window.eventHub.$on('shift_up', this.handle_shift_up)
window.eventHub.$on('alt_down', this.handle_alt_down)
window.eventHub.$on('alt_up', this.handle_alt_up)
window.eventHub.$on('mod_down', this.handle_mod_down)
window.eventHub.$on('mod_up', this.handle_mod_up)
window.eventHub.$on('mod+a_down', this.handle_mod_a_down)
window.eventHub.$on('mod+a_up', this.handle_mod_a_up)
},
unlistenEvent() {
window.eventHub.$off('shift_down', this.handle_shift_down)
window.eventHub.$off('shift_up', this.handle_shift_up)
window.eventHub.$off('alt_down', this.handle_alt_down)
window.eventHub.$off('alt_up', this.handle_alt_up)
window.eventHub.$off('mod_down', this.handle_mod_down)
window.eventHub.$off('mod_up', this.handle_mod_up)
window.eventHub.$off('mod+a_down', this.handle_mod_a_down)
window.eventHub.$off('mod+a_up', this.handle_mod_a_up)
},
@@ -190,11 +190,11 @@ export default {
handle_shift_up() {
if (this.keyEvent.isShiftDown) this.keyEvent.isShiftDown = false
},
handle_alt_down() {
if (!this.keyEvent.isAltDown) this.keyEvent.isAltDown = true
handle_mod_down() {
if (!this.keyEvent.isModDown) this.keyEvent.isModDown = true
},
handle_alt_up() {
if (this.keyEvent.isAltDown) this.keyEvent.isAltDown = false
handle_mod_up() {
if (this.keyEvent.isModDown) this.keyEvent.isModDown = false
},
handle_mod_a_down() {
if (!this.keyEvent.isADown) {
@@ -276,7 +276,7 @@ export default {
event.currentTarget.classList.add('active')
this.selectdData.push(this.listInfo.list[clickIndex])
}
} else if (this.keyEvent.isAltDown) {
} else if (this.keyEvent.isModDown) {
let item = this.listInfo.list[clickIndex]
let index = this.selectdData.indexOf(item)
if (index < 0) {