Skip to content

Commit 304830a

Browse files
authored
feat(runtime-core): respect function name when using defineComponent function shorthand (#1661)
1 parent 1af3531 commit 304830a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: packages/runtime-core/src/apiDefineComponent.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -205,5 +205,7 @@ export function defineComponent<
205205

206206
// implementation, close to no-op
207207
export function defineComponent(options: unknown) {
208-
return isFunction(options) ? { setup: options } : options
208+
return isFunction(options)
209+
? { setup: options, name: options.name }
210+
: options
209211
}

0 commit comments

Comments
 (0)