Mixins trigger an emitted event warning
Version
3.0.2
Reproduction link
https://jsfiddle.net/skirtle/yofbtL0h/
Steps to reproduce
- Click the button. Note the warning.
- Remove the line
app.mixin({})
and re-run the Fiddle. - Clicking the button no longer triggers a warning.
What is expected?
No warning, even with the mixin.
What is actually happening?
[Vue warn]: Component emitted event "update:modelValue" but it is neither
declared in the emits option nor as an "onUpdate:modelValue" prop.
The warning is only supposed to be shown when the emits
option is specified. Nothing in this example specifies an emits
option, so it shouldn't be shown.
The same problem occurs when using the mixins
or extends
options.
I believe it's caused by an inconsistency in normalizeEmitsOptions
:
Without the mixin it returns null
. With the mixin it returns an empty object, which is enough to trigger the warning.
Originally observed in https://github.com/vuejs/docs-next/issues/702