Skip to content

Commit

Permalink
fix(runtime-core): fix event listener is added erroneously to instanc…
Browse files Browse the repository at this point in the history
…e's props

fix vuejs#5520
  • Loading branch information
iwusong committed Mar 4, 2022
1 parent 5898629 commit 04aa312
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/runtime-core/src/componentProps.ts
Expand Up @@ -224,6 +224,11 @@ export function updateProps(
const propsToUpdate = instance.vnode.dynamicProps!
for (let i = 0; i < propsToUpdate.length; i++) {
let key = propsToUpdate[i]
// if the prop key is a declared emit event listener.
// use continue to skip this prop
if (isEmitListener(instance.emitsOptions, key)){
continue
}
// PROPS flag guarantees rawProps to be non-null
const value = rawProps![key]
if (options) {
Expand Down

0 comments on commit 04aa312

Please sign in to comment.