An open API service indexing awesome lists of open source software.

https://github.com/byteboomers/vue-autofocus-directive

Vue autofocus directive
https://github.com/byteboomers/vue-autofocus-directive

autofocus vue vue-autofocus-directive vuejs

Last synced: about 2 months ago
JSON representation

Vue autofocus directive

Awesome Lists containing this project

README

        

# 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

```bash
npm install --save vue-autofocus-directive
```

[npm package link](https://www.npmjs.com/package/vue-autofocus-directive)

## Usage

```javascript
import Vue from "vue";
import autofocus from "vue-autofocus-directive";
Vue.directive("autofocus", autofocus);
```

```html

```

## Options

### `binding`

- Type: `value`
- Default: `undefined`
- Description: _Required when using dynamic value_

## Example

```vue


Email

```

or

```vue


Email

export default {
data() {
return {
dynamicValue: false
};
}
};

```