This commit is contained in:
linzhe 2025-05-05 20:38:29 +00:00 committed by GitHub
commit 01e2fb11e4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 3 deletions

View File

@ -1381,4 +1381,14 @@ describe('compiler: element transform', () => {
],
})
})
test('resolveSetupReference handle `kebab-case` component', () => {
const { node } = parseWithElementTransform(`<view-component/>`, {
isNativeTag: () => false,
bindingMetadata: {
ViewComponent: BindingTypes.SETUP_CONST,
},
})
expect(node.tag).toBe(`$setup["ViewComponent"]`)
})
})

View File

@ -331,12 +331,12 @@ function resolveSetupReference(name: string, context: TransformContext) {
if (bindings[name] === type) {
return name
}
if (bindings[camelName] === type) {
return camelName
}
if (bindings[PascalName] === type) {
return PascalName
}
if (bindings[camelName] === type) {
return camelName
}
}
const fromConst =