October 2019
Intermediate to advanced
108 pages
2h 24m
English
When we added the v-mask library to our project, and added the plugin within main.js, the library created a new directive for us, v-mask. What exactly is a directive, though? We know it looks like an HTML attribute, but what else?
A directive can be defined as follows:
"Directives are special attributes with the v- prefix. Directive attribute values are expected to be a single JavaScript expression (with the exception of v-for […]). A directive's job is to reactively apply side effects to the DOM, when the value of its expression changes". - Official Vue documentation.
Okay, so it looks like we have a special attribute that can modify the element. That sounds exactly like what we saw happen when we applied to ...
Read now
Unlock full access