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
description: disallow `emits` which would shadow native html events
6
+
---
7
+
# vue/no-shadow-native-events
8
+
9
+
> disallow `emits` which would shadow native HTML events
10
+
11
+
-:exclamation: <badgetext="This rule has not been released yet."vertical="middle"type="error"> _**This rule has not been released yet.**_ </badge>
12
+
13
+
## :book: Rule Details
14
+
15
+
This rule reports emits that shadow native HTML events. (The `emits` option is a new in Vue.js 3.0.0+)
16
+
17
+
Using native event names for emits can lead to incorrect assumptions about an emit and cause confusion. This is caused by Vue emits behaving differently from native events. E.g. :
18
+
- The payload of an emit can be chosen arbitrarily
19
+
- Vue emits do not bubble, while most native events do
20
+
-[Event modifiers](https://vuejs.org/guide/essentials/event-handling.html#event-modifiers) only work on HTML events or when the original event is re-emitted as emit payload.
21
+
- When the native event is remitted the `event.target` might not match the actual event-listeners location.
22
+
23
+
The rule is mostly aimed at developers of component libraries.
0 commit comments