Mixins trigger an emitted event warning #2651
Labels
🔨 p3-minor-bug
Priority 3: this fixes a bug, but is an edge case that only affects very specific usage.
🐞 bug
Something isn't working
Version
3.0.2
Reproduction link
https://jsfiddle.net/skirtle/yofbtL0h/
Steps to reproduce
app.mixin({})
and re-run the Fiddle.What is expected?
No warning, even with the mixin.
What is actually happening?
The warning is only supposed to be shown when the
emits
option is specified. Nothing in this example specifies anemits
option, so it shouldn't be shown.The same problem occurs when using the
mixins
orextends
options.I believe it's caused by an inconsistency in
normalizeEmitsOptions
:https://github.com/vuejs/vue-next/blob/2707cbf36e39ff2a54d84fc82ea62d2dc3af5b05/packages/runtime-core/src/componentEmits.ts#L152
Without the mixin it returns
null
. With the mixin it returns an empty object, which is enough to trigger the warning.Originally observed in vuejs/docs#702
The text was updated successfully, but these errors were encountered: