JSFiddle - React, Tailwind, and code Playground
by hunterliu
HTML
<div id="app">
<input v-focus>
</div>
JavaScript
// Register a global custom directive called `v-focus`
Vue.directive('focus', {
// When the bound element is inserted into the DOM...
inserted: function (el) {
// Focus the element
el.focus()
}
})
const vm = new Vue({
el: '#app'
})