@@ -6,6 +6,7 @@ import { resolveConstructorOptions } from '../instance/init'
66import { resolveSlots } from '../instance/render-helpers/resolve-slots'
77
88import {
9+ tip ,
910 warn ,
1011 isObject ,
1112 hasOwn ,
@@ -133,7 +134,7 @@ export function createComponent (
133134 }
134135
135136 // extract props
136- const propsData = extractProps ( data , Ctor )
137+ const propsData = extractProps ( data , Ctor , tag )
137138
138139 // functional component
139140 if ( Ctor . options . functional ) {
@@ -274,7 +275,7 @@ function resolveAsyncComponent (
274275 }
275276}
276277
277- function extractProps ( data : VNodeData , Ctor : Class < Component > ) : ?Object {
278+ function extractProps ( data : VNodeData , Ctor : Class < Component > , tag ?: string ) : ?Object {
278279 // we are only extracting raw values here.
279280 // validation and default values are handled in the child
280281 // component itself.
@@ -293,12 +294,13 @@ function extractProps (data: VNodeData, Ctor: Class<Component>): ?Object {
293294 key !== keyInLowerCase &&
294295 attrs && attrs . hasOwnProperty ( keyInLowerCase )
295296 ) {
296- warn (
297- `Prop "${ keyInLowerCase } " is not declared in component ` +
298- `${ formatComponentName ( Ctor ) } . Note that HTML attributes are ` +
299- `case-insensitive and camelCased props need to use their kebab-case ` +
300- `equivalents when using in-DOM templates. You should probably use ` +
301- `"${ altKey } " instead of "${ key } ".`
297+ tip (
298+ `Prop "${ keyInLowerCase } " is passed to component ` +
299+ `${ formatComponentName ( tag || Ctor ) } , but the delared prop name is` +
300+ ` "${ key } ". ` +
301+ `Note that HTML attributes are case-insensitive and camelCased ` +
302+ `props need to use their kebab-case equivalents when using in-DOM ` +
303+ `templates. You should probably use "${ altKey } " instead of "${ key } ".`
302304 )
303305 }
304306 }
0 commit comments