Skip to content
Back to the blog
Engineering

Is This the End of $emit?

July 10, 2024 3 min read
Is This the End of $emit?

Anyone working with Vue (or Angular) knows that to move data simply between parent and child components, we use the well-known event emitter.

Here's a neat tip to simplify that kind of communication even further: with defineModel, we can pass a model directly from parent to child, making emitters unnecessary in many cases.

The parent binds a ref with v-model; the child declares defineModel and reads or mutates it as if it were local. Less boilerplate, the same two-way intent — and code that reads exactly like what it does.

VuedefineModelFrontend
Loading
Move your cursor to reveal