From 584f2b4b32e69865d9561f1537142791710f676d Mon Sep 17 00:00:00 2001 From: Robin Schneider Date: Sat, 11 Sep 2021 12:42:57 +0200 Subject: Added custom hotkey support --- src/App.vue | 1 + src/components/SearchInput.vue | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/App.vue b/src/App.vue index 1f4f509..9b4803f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -41,6 +41,7 @@ export default { name: "SearchInput", - props: ["value"], + props: { + value: String, + hotkey: { + type: String, + default: "/" + } + }, mounted() { this._keyListener = function (event) { - if (event.key === "/") { + if (event.key === this.hotkey) { event.preventDefault(); this.focus(); } -- cgit v1.2.3