@vuejs-tips/v-autofocus
v0.1.1
Published
Vue autofocus directive
Downloads
13
Readme
Vue autofocus input directive
Demo
https://unpkg.com/@vuejs-tips/v-autofocus/dist/demo.html
https://codesandbox.io/s/v-autofocus-bbg2z?file=/src/App.vue
Usage
<template>
<div>
<input v-autofocus />
</div>
</template>
<script>
import autofocus from "@vuejs-tips/v-autofocus"
export default {
directives: {
autofocus
}
}
</script>
Or importing globally as a plugin:
import autofocus from "@vuejs-tips/v-autofocus"
Vue.use(autofocus)