This repository was archived by the owner on Jul 19, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +11
-16
lines changed
packages/runtime-vapor/src Expand file tree Collapse file tree 1 file changed +11
-16
lines changed Original file line number Diff line number Diff line change @@ -178,22 +178,17 @@ export function formatComponentName(
178178 }
179179 }
180180
181- // TODO registry
182- // if (!name && instance && instance.parent) {
183- // // try to infer the name based on reverse resolution
184- // const inferFromRegistry = (registry: Record<string, any> | undefined) => {
185- // for (const key in registry) {
186- // if (registry[key] === Component) {
187- // return key
188- // }
189- // }
190- // }
191- // name =
192- // inferFromRegistry(
193- // instance.components ||
194- // (instance.parent.type as ComponentOptions).components,
195- // ) || inferFromRegistry(instance.appContext.components)
196- // }
181+ if ( ! name && instance && instance . parent ) {
182+ // try to infer the name based on reverse resolution
183+ const inferFromRegistry = ( registry : Record < string , any > | undefined ) => {
184+ for ( const key in registry ) {
185+ if ( registry [ key ] === Component ) {
186+ return key
187+ }
188+ }
189+ }
190+ name = inferFromRegistry ( instance . appContext . components )
191+ }
197192
198193 return name ? classify ( name ) : isRoot ? `App` : `Anonymous`
199194}
You can’t perform that action at this time.
0 commit comments