Skip to content

Commit 99c84f0

Browse files
Update events.md
fix: Oops, the event object in $emit needs its event prototype of course, so no spreading notation is possible.
1 parent a5e4052 commit 99c84f0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/v2/guide/events.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ To address this problem, Vue provides **event modifiers** for `v-on`. Recall tha
181181
Please note that with the exception of `.once` the modifiers above only work with **native events**.
182182

183183
<p class="tip">
184-
When emitting native-looking events from components, such as 'click', it is a good practice to also emit the native event. eg. `this.$emit('click', {...data, ...event})`. If you haven't read about components yet, don't worry about this for now.
184+
When emitting native-looking events from components, such as 'click', it is a good practice to also emit the native event. eg. `event.data = {...}; this.$emit('click', event)`. If you haven't read about components yet, don't worry about this for now.
185185
</p>
186186

187187
<!-- the click event's propagation will be stopped -->

0 commit comments

Comments
 (0)