File tree 1 file changed +15
-3
lines changed
packages/runtime-core/src/helpers
1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change 1
1
import { currentRenderingInstance } from '../componentRenderUtils'
2
- import { currentInstance , Component , FunctionalComponent } from '../component'
2
+ import {
3
+ currentInstance ,
4
+ Component ,
5
+ FunctionalComponent ,
6
+ ComponentOptions
7
+ } from '../component'
3
8
import { Directive } from '../directives'
4
9
import {
5
10
camelize ,
@@ -69,8 +74,15 @@ function resolveAsset(
69
74
res = self
70
75
}
71
76
}
72
- if ( __DEV__ && warnMissing && ! res ) {
73
- warn ( `Failed to resolve ${ type . slice ( 0 , - 1 ) } : ${ name } ` )
77
+ if ( __DEV__ ) {
78
+ if ( res ) {
79
+ // in dev, infer anonymous component's name based on registered name
80
+ if ( type === COMPONENTS && ! ( res as Component ) . name ) {
81
+ ; ( res as ComponentOptions ) . name = name
82
+ }
83
+ } else if ( warnMissing ) {
84
+ warn ( `Failed to resolve ${ type . slice ( 0 , - 1 ) } : ${ name } ` )
85
+ }
74
86
}
75
87
return res
76
88
} else if ( __DEV__ ) {
You can’t perform that action at this time.
0 commit comments