Shivam Mishra

Front End engineering at DeepSource, focusing on Vue, Nuxt, TypeScript with a pinch of GraphQL. This page has a list of my projects and my writings. You can find me on twitter @scmmishra and on GitHub.


25 Nov, 2022

Vue Outside Click Directive

You might have used v-model, v-if, v-for or v-show shipped with Vue Core. These utilities are called directives, these are tiny commands that you can attach to DOM elements.

Vue Directives

When building apps, the primary form of code reuse and abstraction that Vue has to offer is components - however there may be cases where you may need some low-level DOM access on plain elements, and this is where custom directives should be used. It’s important to note that directives are meant to encapsulate DOM manipulations only, while components are self-contained units that have their own view and data logic.

📫  Let's stay in touch?

I'll send an email only when I publish something on my blog, which is usually once month at best, and you can unsubscribe instantly at any time. So don't worry about spam. I use Buttondown to host this newsletter, It's trusted by many for it's privacy practices, you can read more here.

If you're interested, drop your email below

Powered by Buttondown.