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

This commit is contained in:
Bjarki Hall 2020-07-21 17:15:26 +00:00 committed by GitHub
parent 1af3531719
commit 304830a764
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
}