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(
178
178
}
179
179
}
180
180
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
+ }
197
192
198
193
return name ? classify ( name ) : isRoot ? `App` : `Anonymous`
199
194
}
You can’t perform that action at this time.
0 commit comments