Custom Directives

Download vue.js eBook

Syntax

  • Vue.directive(id, definition);
  • Vue.directive(id, update); //when you need only the update function.

Parameters

ParameterDetails
idString - The directive id that will be used without the v- prefix. (Add the v- prefix when using it)
definitionObject - A definition object can provide several hook functions (all optional): bind, update, and unbind

Related Examples

Stats

1030 Contributors: 2
Monday, March 13, 2017
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook