fix(runtime-core): only infer component name for object components

close #1023
This commit is contained in:
Evan You 2020-04-22 04:39:02 -04:00
parent 2bb6f9b5c9
commit e422b8b082

View File

@ -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) {