From 584f2b4b32e69865d9561f1537142791710f676d Mon Sep 17 00:00:00 2001 From: Robin Schneider Date: Sat, 11 Sep 2021 12:42:57 +0200 Subject: [PATCH] Added custom hotkey support --- docs/configuration.md | 2 ++ src/App.vue | 1 + src/components/SearchInput.vue | 10 ++++++++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index a472b41..93abadb 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -19,6 +19,8 @@ logo: "assets/logo.png" # icon: "fas fa-skull-crossbones" header: true # Set to false to hide the header +# Optional: Different hotkey for search, defaults to "/" +# hotkey: "Shift" footer: '

Created with ❤️ with bulma, vuejs & font awesome // Fork me on

' # set false if you want to hide it. columns: "3" # "auto" or number (must be a factor of 12: 1, 2, 3, 4, 6, 12) 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(); } -- 2.41.0