diff options
author | Robin Schneider <robin-schneider@outlook.de> | 2021-09-11 12:42:57 +0200 |
---|---|---|
committer | Robin Schneider <robin-schneider@outlook.de> | 2021-09-11 12:42:57 +0200 |
commit | 584f2b4b32e69865d9561f1537142791710f676d (patch) | |
tree | e56da69a2f4793a65171a99dd234de2bcae0bc51 /src/components/SearchInput.vue | |
parent | 6b54eedae7bf2632fbb1ec1d9419a7b71cf102cc (diff) | |
download | homer-584f2b4b32e69865d9561f1537142791710f676d.tar.gz homer-584f2b4b32e69865d9561f1537142791710f676d.tar.zst homer-584f2b4b32e69865d9561f1537142791710f676d.zip |
Added custom hotkey support
Diffstat (limited to 'src/components/SearchInput.vue')
-rw-r--r-- | src/components/SearchInput.vue | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/components/SearchInput.vue b/src/components/SearchInput.vue index 40c5a1d..c4c11a2 100644 --- a/src/components/SearchInput.vue +++ b/src/components/SearchInput.vue | |||
@@ -15,10 +15,16 @@ | |||
15 | <script> | 15 | <script> |
16 | export default { | 16 | export default { |
17 | name: "SearchInput", | 17 | name: "SearchInput", |
18 | props: ["value"], | 18 | props: { |
19 | value: String, | ||
20 | hotkey: { | ||
21 | type: String, | ||
22 | default: "/" | ||
23 | } | ||
24 | }, | ||
19 | mounted() { | 25 | mounted() { |
20 | this._keyListener = function (event) { | 26 | this._keyListener = function (event) { |
21 | if (event.key === "/") { | 27 | if (event.key === this.hotkey) { |
22 | event.preventDefault(); | 28 | event.preventDefault(); |
23 | this.focus(); | 29 | this.focus(); |
24 | } | 30 | } |