Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(runtime-core): optimization the logic of setting __props (close #2651) #2654

Closed
wants to merge 8 commits into from
4 changes: 3 additions & 1 deletion packages/runtime-core/src/componentEmits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@ export function normalizeEmitsOptions(
} else {
extend(normalized, raw)
}
return (comp.__emits = normalized)
// #2651 if normalized is empty and !raw should return null
return (comp.__emits =
!Object.keys(normalized).length && !raw ? null : normalized)
edison1105 marked this conversation as resolved.
Show resolved Hide resolved
}

// Check if an incoming prop key is a declared emit event listener.
Expand Down