Skip to content

Commit

Permalink
feat(runtime-core): respect function name when using `defineComponent…
Browse files Browse the repository at this point in the history
…` function shorthand (#1661)
  • Loading branch information
bjarkihall authored Jul 21, 2020
1 parent 1af3531 commit 304830a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/runtime-core/src/apiDefineComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 304830a

Please sign in to comment.