From: Evan You Date: Thu, 11 Oct 2018 18:27:02 +0000 (-0400) Subject: feat: alias $attrs to $props when component has no declared props X-Git-Tag: v3.0.0-alpha.0~1123 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3a7bbecb22d6240b93ba110633966a9a7ea48b8d;p=thirdparty%2Fvuejs%2Fcore.git feat: alias $attrs to $props when component has no declared props --- diff --git a/packages/core/src/componentProps.ts b/packages/core/src/componentProps.ts index d8618acb74..936f733d95 100644 --- a/packages/core/src/componentProps.ts +++ b/packages/core/src/componentProps.ts @@ -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 } }