GitHub - byteboomers/vue-autofocus-directive: Vue autofocus directive (original) (raw)
vue-autofocus-directive
Autofocus directive for Vue
About
Lifted from the official Vue tutorial: https://vuejs.org/v2/guide/custom-directive.html
When the page loads, the element with the directive gains focus (note: autofocus doesn’t work on mobile Safari).
Installation
npm install --save vue-autofocus-directive
Usage
import Vue from "vue"; import autofocus from "vue-autofocus-directive"; Vue.directive("autofocus", autofocus);
Options
binding
- Type:
value - Default:
undefined - Description: Required when using dynamic value
Example
Emailor
Email