How to set focus on textfeild by pressing forward slash in vuejs?

Viewed 553

Is there any idea on how to do I set my cursor focus on textfeild, the functionality is similar to the vuetify website when we visit vuetify website there is search feild which has a placeholder (Search "/" to focus) the same functionality I want to achieve it in my website.

I am using vuejs with vuetify.

Any help with example would be appreciated.

1 Answers

or simply use this

<template>
  <div>
    <input id="input1" v-on:keyup.191="inpFocus">
  </div>
</template>

<script>
  name: "something",
  .
  .
  .
  methods: {
    inpFocus(){
      document.getElementById("input1").focus();
    }
  }
</script>
Related