@nomnes/vue-autofocus
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

@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' });

Readme

Keywords

none

Package Sidebar

Install

npm i @nomnes/vue-autofocus

Weekly Downloads

1

Version

0.0.4

License

MIT

Unpacked Size

1.96 kB

Total Files

7

Last publish

Collaborators

  • nomnes