Vue.directive( id, [definition] )
-
Arguments:
{String} id
{Function | Object} [definition]
-
Usage:
Register or retrieve a global directive.
1234567891011121314// 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 also: Custom Directives
Please login to continue.