mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 21:38:13 +00:00
Wywoływanie filtrów za pomocą klawisza F
This commit is contained in:
@@ -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();
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user