refactor(runtime-core): extract common getComponentName function (#2454)

This commit is contained in:
edison
2020-12-05 06:03:03 +08:00
committed by GitHub
parent b2189ba2f3
commit 82bf7ebf36
3 changed files with 16 additions and 15 deletions

View File

@@ -2,8 +2,8 @@ import { currentRenderingInstance } from '../componentRenderUtils'
import {
currentInstance,
ConcreteComponent,
FunctionalComponent,
ComponentOptions
ComponentOptions,
getComponentName
} from '../component'
import { Directive } from '../directives'
import { camelize, capitalize, isString } from '@vue/shared'
@@ -73,8 +73,7 @@ function resolveAsset(
return Component
}
const selfName =
(Component as FunctionalComponent).displayName || Component.name
const selfName = getComponentName(Component)
if (
selfName &&
(selfName === name ||