fix(compiler-core): allow PascalCase dynamic component tag usage (#3508)
fix #3507
This commit is contained in:
@@ -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 = isComponentTag(tag)
|
||||
? findProp(node, 'is')
|
||||
: findDir(node, 'is')
|
||||
if (isProp) {
|
||||
const exp =
|
||||
isProp.type === NodeTypes.ATTRIBUTE
|
||||
@@ -413,7 +414,7 @@ export function buildProps(
|
||||
}
|
||||
}
|
||||
// skip :is on <component>
|
||||
if (name === 'is' && tag === 'component') {
|
||||
if (name === 'is' && isComponentTag(tag)) {
|
||||
continue
|
||||
}
|
||||
properties.push(
|
||||
@@ -452,7 +453,7 @@ export function buildProps(
|
||||
// skip v-is and :is on <component>
|
||||
if (
|
||||
name === 'is' ||
|
||||
(isBind && tag === 'component' && isBindKey(arg, 'is'))
|
||||
(isBind && isComponentTag(tag) && isBindKey(arg, 'is'))
|
||||
) {
|
||||
continue
|
||||
}
|
||||
@@ -672,3 +673,7 @@ function stringifyDynamicPropNames(props: string[]): string {
|
||||
}
|
||||
return propsNamesString + `]`
|
||||
}
|
||||
|
||||
function isComponentTag(tag: string) {
|
||||
return tag[0].toLowerCase() + tag.slice(1) === 'component'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user