Procházet zdrojové kódy

fix(runtime-core): fix event listener as dynamicProp is added erroneously to props (#5517)

fix #5520
iwusong před 4 roky
rodič
revize
8eceabd14e
1 změnil soubory, kde provedl 4 přidání a 0 odebrání
  1. 4 0
      packages/runtime-core/src/componentProps.ts

+ 4 - 0
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) {