From 304830a764cd9f28098cfb0ac0e520e1bb2f57c7 Mon Sep 17 00:00:00 2001 From: Bjarki Hall Date: Tue, 21 Jul 2020 17:15:26 +0000 Subject: [PATCH] feat(runtime-core): respect function name when using `defineComponent` function shorthand (#1661) --- packages/runtime-core/src/apiDefineComponent.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/runtime-core/src/apiDefineComponent.ts b/packages/runtime-core/src/apiDefineComponent.ts index 1a22c50f..b85e3b3b 100644 --- a/packages/runtime-core/src/apiDefineComponent.ts +++ b/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 }