feat: alias $attrs to $props when component has no declared props

This commit is contained in:
Evan You 2018-10-11 14:27:02 -04:00
parent c94ce3ed62
commit 3a7bbecb22

View 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 }
}