# autofocus

Vue directive to bring focus to an element when it mounts to the page.

Source

# Installation

Global install:

import Vue from "vue"
import { autofocus } from "vuetensils/src/directives"

Vue.directive("autofocus", autofocus)

Local install:

<script>
  import { autofocus } from "vuetensils/src/directives"

  export default {
    directives: {
      autofocus,
    },
  }
</script>

# Usage

With multiple elements, focus will land on the latest in the DOM.

Last Updated: 4/15/2020, 12:16:00 AM