@nomnes/vue-autofocus
v0.0.4
Published
vue autofocus directive
Downloads
3
Readme
@nomnes/vue-autofocus
Autofocus directive for Vue
npm install @nomnes/vue-autofocus
#or
yarn add @nomnes/vue-autofocus
Usage
import Vue from "vue";
import autofocus from "@nomnes/vue-autofocus";
Vue.use(autofocus);
or
import Vue from "vue";
import { autofocus } from "@nomnes/vue-autofocus";
Vue.directive("autofocus", autofocus);
and then in template:
<input v-autofocus/>
Options
When used as a plugin, the name of the directive can be passed using the options:
import Vue from "vue";
import autofocus from "@nomnes/vue-autofocus";
Vue.use(autofocus, { name: 'autofocus' });