fix(runtime-core): respect props from mixins and extends

fix #1236, close #1250
This commit is contained in:
Evan You
2020-06-09 11:27:40 -04:00
parent dc986addd9
commit 2417a0cb30
5 changed files with 95 additions and 40 deletions

View File

@@ -44,7 +44,7 @@ export function emit(
const options = normalizeEmitsOptions(instance.type.emits)
if (options) {
if (!(event in options)) {
const propsOptions = normalizePropsOptions(instance.type.props)[0]
const propsOptions = normalizePropsOptions(instance.type)[0]
if (!propsOptions || !(`on` + capitalize(event) in propsOptions)) {
warn(
`Component emitted event "${event}" but it is neither declared in ` +