Learn How to Emit Custom Events in Vue With $emitby@smpnjn
7,802 reads

Learn How to Emit Custom Events in Vue With $emit

May 15th 2022
6m
by @smpnjn 7,802 reads
tldt arrow
Read on Terminal Reader
Read this story w/o Javascript

Too Long; Didn't Read

In Vue, data is typically passed from parent components to their children in a uni-directional fashion. This is transferred with [props], which are the properties or attributes we give to [components] Props allow us to do everything we need to do with data. Sometimes, however, we use `$emit` to send data upwards, and then trigger an event in the parent component should an event be fired. There are three ways to fire events in Vue - depending on if you're using the Options API, Composition API, or inlining your events.

Company Mentioned

Mention Thumbnail
featured image - Learn How to Emit Custom Events in Vue With $emit
Johnny Simpson HackerNoon profile picture

@smpnjn

Johnny Simpson

Product, Engineering, Web


Receive Stories from @smpnjn

react to story with heart

RELATED STORIES

L O A D I N G
. . . comments & more!