🐛 Fix: shift key function in gallery page

This commit is contained in:
PiEgg
2021-08-28 21:50:46 +08:00
parent 58420c8c3b
commit 5895889059
2 changed files with 607 additions and 190 deletions

View File

@@ -178,8 +178,12 @@ export default class extends Vue {
document.addEventListener('keyup', this.handleDetectShiftKey)
}
handleDetectShiftKey (event: KeyboardEvent) {
if (event.keyCode === 16) {
this.isShiftKeyPress = !this.isShiftKeyPress
if (event.key === 'Shift') {
if (event.type === 'keydown') {
this.isShiftKeyPress = true
} else if (event.type === 'keyup') {
this.isShiftKeyPress = false
}
}
}
get filterList () {