vue, emitting vs passing function as props

The Vue philosophy is props down, events up. The first option follows that closer as the event itself is emitted (up) to the parent and then handled.

Also within a Vue SFC you have the added benefit of prefixing the bound attribute with a v-on (or @) which describes its intent as an event traveling up and not a v-bind (or 🙂 which implies it’s a prop even though its really a callback to an event.

Leave a Comment