🚧 PLEASE NOTE: An updated version of this course is available! see the Vue.js 3 Custom Directives course. This course is outdated!

About the Custom Vue Directives course

Vue.js Directives are special HTML attributes that allow us to manipulate the DOM. Directives are very powerful and we use them every day.

Common directives are v-if, v-for and v-model.

The course covers all you need to know to be able to create your own, custom vue.js directives. In the course, we create three different directives to showcase the possibilities and power of custom vue.js directives.

The Directives

v-color allows us to easily add a CSS color to an HTML element.

v-switching-color changes the CSS color of the element every 500 milliseconds.

v-click-outside allows us to attach an event handler to when a user clicks outside an element. Perfect for modals and pop-over menus, toolboxes etc.

While the two first might seem silly, the possibilities with these patterns are very powerful. The course also teaches you what you need to know about directive modifiers and hooks.

Important!

This course uses Vue 2. While the directives API has changed slightly in Vue 3 many of the concepts taught in this course are the same.

View what's changed in the Vue 3 Docs Migartion Guide.

Also you can see Vue 3 directives in action in the Vue.js 3 Master Class.

What you will learn in the Custom Vue Directives course

Understanding Vue.js Directives
Learn How to Create Directives
Learn How to Create Directives with Arguments
Learn How to Create Directive Modifiers

Share this course

Request a course

Who's behind the course

Alex Kyriakidis - Teacher
Alex is an educator and consultant, core member of the Vue.js team and author of the first best-selling books on Vue.js.
Rolf Haug - Contributor / Reviewer
Rolf has been in development industry for 16 years. Long-time entrepreneur and consultant currently working on educational content and workshops.