Skip to content

Commit a5e4052

Browse files
Update events.md
Added more explanation to modifiers that require a native event, otherwise generating surprising error messages.
1 parent 8736949 commit a5e4052

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/v2/guide/events.md

+6
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,12 @@ To address this problem, Vue provides **event modifiers** for `v-on`. Recall tha
178178
- `.passive`
179179

180180
``` html
181+
Please note that with the exception of `.once` the modifiers above only work with **native events**.
182+
183+
<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.
185+
</p>
186+
181187
<!-- the click event's propagation will be stopped -->
182188
<a v-on:click.stop="doThis"></a>
183189

0 commit comments

Comments
 (0)