Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Vue directive

// 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()
  }
})
Source by vuejs.org #
 
PREVIOUS NEXT
Tagged: #Vue #directive
ADD COMMENT
Topic
Name
8+8 =