]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(runtime-core): fix event listener as dynamicProp is added erroneously to props...
authoriwusong <wusong3918@gmail.com>
Tue, 12 Apr 2022 06:42:00 +0000 (14:42 +0800)
committerGitHub <noreply@github.com>
Tue, 12 Apr 2022 06:42:00 +0000 (02:42 -0400)
fix #5520

packages/runtime-core/src/componentProps.ts

index 8c09903ecb19d449aa6de2cd62f640fb3fe813e9..ad691607608d06e002fa2b3b67eecc9e4917f1c3 100644 (file)
@@ -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) {