fix(compiler-core): only check is prop on <component>

This commit is contained in:
Evan You 2020-01-31 16:15:05 -05:00
parent 74cb207c22
commit 78c4f321cd

View File

@ -73,8 +73,7 @@ export const transformElement: NodeTransform = (node, context) => {
let shouldUseBlock = false let shouldUseBlock = false
// handle dynamic component // handle dynamic component
const isProp = findProp(node, 'is') const isProp = tag === 'component' && findProp(node, 'is')
if (tag === 'component') {
if (isProp) { if (isProp) {
// static <component is="foo" /> // static <component is="foo" />
if (isProp.type === NodeTypes.ATTRIBUTE) { if (isProp.type === NodeTypes.ATTRIBUTE) {
@ -94,7 +93,6 @@ export const transformElement: NodeTransform = (node, context) => {
) )
} }
} }
}
let nodeType let nodeType
if (dynamicComponent) { if (dynamicComponent) {