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
close #1023
  • Loading branch information
yyx990803 committed Apr 22, 2020
1 parent 2bb6f9b commit e422b8b
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 e422b8b

Please sign in to comment.