From 04aa3122d3f00d73953943f3db04137613c8c1b4 Mon Sep 17 00:00:00 2001 From: iwusong Date: Fri, 4 Mar 2022 17:13:22 +0800 Subject: [PATCH] fix(runtime-core): fix event listener is added erroneously to instance's props fix #5520 --- packages/runtime-core/src/componentProps.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/runtime-core/src/componentProps.ts b/packages/runtime-core/src/componentProps.ts index 7ed8aeee4a1..fa0839663b6 100644 --- a/packages/runtime-core/src/componentProps.ts +++ b/packages/runtime-core/src/componentProps.ts @@ -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) {