Browse Source

feat(runtime-core): respect function name when using `defineComponent` function shorthand (#1661)

Bjarki Hall 5 years ago
parent
commit
304830a764
1 changed files with 3 additions and 1 deletions
  1. 3 1
      packages/runtime-core/src/apiDefineComponent.ts

+ 3 - 1
packages/runtime-core/src/apiDefineComponent.ts

@@ -205,5 +205,7 @@ export function defineComponent<
 
 // implementation, close to no-op
 export function defineComponent(options: unknown) {
-  return isFunction(options) ? { setup: options } : options
+  return isFunction(options)
+    ? { setup: options, name: options.name }
+    : options
 }