mirror of
https://github.com/bastienwirtz/homer.git
synced 2025-10-30 01:36:06 +01:00
Added custom hotkey support
This commit is contained in:
@@ -15,10 +15,16 @@
|
||||
<script>
|
||||
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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user