fix(runtime-core/emits): merge emits options from mixins/extends

fix #1562
This commit is contained in:
Evan You
2020-07-13 11:55:46 -04:00
parent c2d3da9dc4
commit ba3b3cdda9
4 changed files with 87 additions and 32 deletions

View File

@@ -242,8 +242,6 @@ function setFullProps(
attrs: Data
) {
const [options, needCastKeys] = normalizePropsOptions(instance.type)
const emits = instance.type.emits
if (rawProps) {
for (const key in rawProps) {
const value = rawProps[key]
@@ -256,7 +254,7 @@ function setFullProps(
let camelKey
if (options && hasOwn(options, (camelKey = camelize(key)))) {
props[camelKey] = value
} else if (!emits || !isEmitListener(emits, key)) {
} else if (!isEmitListener(instance.type, key)) {
// Any non-declared (either as a prop or an emitted event) props are put
// into a separate `attrs` object for spreading. Make sure to preserve
// original key casing