Wywoływanie filtrów za pomocą klawisza F

This commit is contained in:
2022-09-22 14:57:03 +02:00
parent 0a8bfe4c52
commit bcf750d451
5 changed files with 79 additions and 14 deletions
+25
View File
@@ -0,0 +1,25 @@
import { defineComponent } from 'vue';
export default defineComponent({
data() {
return {
preventKeyDown: false,
};
},
activated() {
window.addEventListener('keydown', this.handleKeyDown);
},
deactivated() {
window.removeEventListener('keydown', this.handleKeyDown);
},
methods: {
onKeyDownFunction() {},
handleKeyDown(e: KeyboardEvent) {
if (e.key.toLowerCase() == 'f' && !this.preventKeyDown) this.onKeyDownFunction();
},
},
});