fix(compiler-core): allow PascalCase dynamic component tag usage (#3508)

fix #3507
This commit is contained in:
HcySunYang
2021-03-30 03:18:25 +08:00
committed by GitHub
parent 3736496006
commit 555b016dcb
2 changed files with 27 additions and 4 deletions

View File

@@ -836,6 +836,24 @@ describe('compiler: element transform', () => {
})
})
test('capitalized version w/ static binding', () => {
const { node, root } = parseWithBind(`<Component is="foo" />`)
expect(root.helpers).toContain(RESOLVE_DYNAMIC_COMPONENT)
expect(node).toMatchObject({
isBlock: true,
tag: {
callee: RESOLVE_DYNAMIC_COMPONENT,
arguments: [
{
type: NodeTypes.SIMPLE_EXPRESSION,
content: 'foo',
isStatic: true
}
]
}
})
})
test('dynamic binding', () => {
const { node, root } = parseWithBind(`<component :is="foo" />`)
expect(root.helpers).toContain(RESOLVE_DYNAMIC_COMPONENT)