Skip to content

Commit

Permalink
fix(runtime-core): only infer component name for object components
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 authored and pikax committed Apr 29, 2020
1 parent 8e2a64d commit 3f12f8f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/runtime-core/src/helpers/resolveAssets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ function resolveAsset(
if (__DEV__) {
if (res) {
// in dev, infer anonymous component's name based on registered name
if (type === COMPONENTS && !(res as Component).name) {
if (
type === COMPONENTS &&
isObject(res) &&
!(res as ComponentOptions).name
) {
;(res as ComponentOptions).name = name
}
} else if (warnMissing) {
Expand Down

0 comments on commit 3f12f8f

Please sign in to comment.