From 8eceabd14ebab2ba6523f920134b02fdf21e0a1c Mon Sep 17 00:00:00 2001 From: iwusong Date: Tue, 12 Apr 2022 14:42:00 +0800 Subject: [PATCH] fix(runtime-core): fix event listener as dynamicProp is added erroneously to props (#5517) fix #5520 --- packages/runtime-core/src/componentProps.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/runtime-core/src/componentProps.ts b/packages/runtime-core/src/componentProps.ts index 8c09903e..ad691607 100644 --- a/packages/runtime-core/src/componentProps.ts +++ b/packages/runtime-core/src/componentProps.ts @@ -225,6 +225,10 @@ export function updateProps( const propsToUpdate = instance.vnode.dynamicProps! for (let i = 0; i < propsToUpdate.length; i++) { let key = propsToUpdate[i] + // skip if the prop key is a declared emit event listener + if (isEmitListener(instance.emitsOptions, key)){ + continue + } // PROPS flag guarantees rawProps to be non-null const value = rawProps![key] if (options) {