@@ -6,6 +6,7 @@ import { resolveConstructorOptions } from '../instance/init'
6
6
import { resolveSlots } from '../instance/render-helpers/resolve-slots'
7
7
8
8
import {
9
+ tip ,
9
10
warn ,
10
11
isObject ,
11
12
hasOwn ,
@@ -133,7 +134,7 @@ export function createComponent (
133
134
}
134
135
135
136
// extract props
136
- const propsData = extractProps ( data , Ctor )
137
+ const propsData = extractProps ( data , Ctor , tag )
137
138
138
139
// functional component
139
140
if ( Ctor . options . functional ) {
@@ -274,7 +275,7 @@ function resolveAsyncComponent (
274
275
}
275
276
}
276
277
277
- function extractProps ( data : VNodeData , Ctor : Class < Component > ) : ?Object {
278
+ function extractProps ( data : VNodeData , Ctor : Class < Component > , tag ?: string ) : ?Object {
278
279
// we are only extracting raw values here.
279
280
// validation and default values are handled in the child
280
281
// component itself.
@@ -293,12 +294,13 @@ function extractProps (data: VNodeData, Ctor: Class<Component>): ?Object {
293
294
key !== keyInLowerCase &&
294
295
attrs && attrs . hasOwnProperty ( keyInLowerCase )
295
296
) {
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 } ".`
302
304
)
303
305
}
304
306
}
0 commit comments