Learn Vue JS course Learn Javascript and Vue JS Learn VueJS course Learn VueJS Tutorial

The Vue.js Master Class

Get access to the most comprehensive Vue.js video library in the world. Over 300 video lessons including the newest Vue 3 features.

Close Dropdown on Click Outside

In this lesson, we're implementing the v-click-outside directive that we made in the Custome Vue.js Directives course. We import the directive in the navbar component since we don't need it globally available. We use the directive to close the dropdown menu in the navbar.