Vue.directive( id, [definition] )
Arguments: {String} id {Function | Object} [definition]
Usage: Register or retrieve a global directive. // register
Vue.directive('my-directive', {
bind: function () {},
update: function () {},
unbind: function () {}
})
// register (simple function directive)
Vue.directive('my-directive', function () {
// this will be called as `update`
})
// getter, return the directive definition if registered
var myDirective = Vue.directive('my-directive')
See