File tree 2 files changed +12
-17
lines changed
packages/runtime-vapor/src
2 files changed +12
-17
lines changed Original file line number Diff line number Diff line change @@ -439,22 +439,17 @@ export function formatComponentName(
439
439
}
440
440
}
441
441
442
- // TODO registry
443
- // if (!name && instance && instance.parent) {
444
- // // try to infer the name based on reverse resolution
445
- // const inferFromRegistry = (registry: Record<string, any> | undefined) => {
446
- // for (const key in registry) {
447
- // if (registry[key] === Component) {
448
- // return key
449
- // }
450
- // }
451
- // }
452
- // name =
453
- // inferFromRegistry(
454
- // instance.components ||
455
- // (instance.parent.type as ComponentOptions).components,
456
- // ) || inferFromRegistry(instance.appContext.components)
457
- // }
442
+ if ( ! name && instance && instance . parent ) {
443
+ // try to infer the name based on reverse resolution
444
+ const inferFromRegistry = ( registry : Record < string , any > | undefined ) => {
445
+ for ( const key in registry ) {
446
+ if ( registry [ key ] === Component ) {
447
+ return key
448
+ }
449
+ }
450
+ }
451
+ name = inferFromRegistry ( instance . appContext . components )
452
+ }
458
453
459
454
return name ? classify ( name ) : isRoot ? `App` : `Anonymous`
460
455
}
Original file line number Diff line number Diff line change 1
1
import { camelize , capitalize } from '@vue/shared'
2
2
import { type Directive , warn } from '..'
3
3
import { type Component , currentInstance } from '../component'
4
- import { getComponentName } from '../warning '
4
+ import { getComponentName } from '../component '
5
5
6
6
export const COMPONENTS = 'components'
7
7
export const DIRECTIVES = 'directives'
You can’t perform that action at this time.
0 commit comments