You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Although optional, it is recommended to define all emitted events in order to better document how a component should work. It also allows Vue to exclude known listeners from [fallthrough attributes](/guide/components/attrs#v-on-listener-inheritance), avoiding edge cases caused by DOM events manually dispatched by 3rd party code.
avoiding edge cases caused by DOM events manually dispatched by 3rd party code
The problem is that these same listeners can also be triggered by custom events - in the above example, both a native click event and a custom one emitted by this.$emit('click') in the child will trigger the parent's foo handler. This may lead to unwanted behavior.
I don't quite understand why edge cases are caused by 3rd party code manually dispatch event?
If declare the events in emits option, should the events only manually dispatched by code be the target's behavior?
The text was updated successfully, but these errors were encountered:
docs/src/guide/components/events.md
Line 225 in 1faadee
vuejs/core#27
I don't quite understand why edge cases are caused by 3rd party code manually dispatch event?
If declare the events in emits option, should the events only manually dispatched by code be the target's behavior?
The text was updated successfully, but these errors were encountered: