]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
feat: alias $attrs to $props when component has no declared props
authorEvan You <yyx990803@gmail.com>
Thu, 11 Oct 2018 18:27:02 +0000 (14:27 -0400)
committerEvan You <yyx990803@gmail.com>
Thu, 11 Oct 2018 18:27:02 +0000 (14:27 -0400)
packages/core/src/componentProps.ts

index d8618acb749da69f62543d4ecc6b17f82492c524..936f733d958e9cadeed884c51507e253dd1ad432 100644 (file)
@@ -84,6 +84,9 @@ export function resolveProps(
         validateProp(key, unwrap(rawData[key]), opt, isAbsent)
       }
     }
+  } else {
+    // if component has no declared props, $attrs === $props
+    attrs = props
   }
   return { props, attrs }
 }