Skip to content

Commit

Permalink
fix(compiler-core): allow capitalized resolve dynamic component
Browse files Browse the repository at this point in the history
  • Loading branch information
cathrinevaage committed Mar 29, 2021
1 parent 4a24a6b commit 5540b70
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/compiler-core/src/transforms/transformElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,9 @@ export function resolveComponentType(
const { tag } = node

// 1. dynamic component
const isProp =
node.tag === 'component' ? findProp(node, 'is') : findDir(node, 'is')
const isProp = ['component', 'Component'].includes(node.tag)
? findProp(node, 'is')
: findDir(node, 'is')
if (isProp) {
const exp =
isProp.type === NodeTypes.ATTRIBUTE
Expand Down Expand Up @@ -413,7 +414,7 @@ export function buildProps(
}
}
// skip :is on <component>
if (name === 'is' && tag === 'component') {
if (name === 'is' && ['component', 'Component'].includes(tag)) {
continue
}
properties.push(
Expand Down Expand Up @@ -452,7 +453,9 @@ export function buildProps(
// skip v-is and :is on <component>
if (
name === 'is' ||
(isBind && tag === 'component' && isBindKey(arg, 'is'))
(isBind &&
['component', 'Component'].includes(tag) &&
isBindKey(arg, 'is'))
) {
continue
}
Expand Down

0 comments on commit 5540b70

Please sign in to comment.