Last active
March 18, 2021 01:30
-
-
Save tohagan/5bff56b9e2a39747036859696435ef10 to your computer and use it in GitHub Desktop.
Select search box using key stroke
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```js | |
<!-- watch for ctrl-/ - Vue2 only. --> | |
<div @keyup.ctrl.191="$root.$emit('onSearchFocus')" /> | |
... | |
<v-text-field ref="search" ... > | |
... | |
</v-text-field> | |
created() { | |
this.$root.$on("onSearchFocus", () => { | |
debugger; | |
const search: any = this.$refs.search; | |
search.$refs.input.focus(); | |
}); | |
} | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment