mirror of https://github.com/vuejs/core.git
Merge a92fbdbcd0
into 56be3dd4db
This commit is contained in:
commit
01e2fb11e4
|
@ -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"]`)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -331,12 +331,12 @@ function resolveSetupReference(name: string, context: TransformContext) {
|
||||||
if (bindings[name] === type) {
|
if (bindings[name] === type) {
|
||||||
return name
|
return name
|
||||||
}
|
}
|
||||||
if (bindings[camelName] === type) {
|
|
||||||
return camelName
|
|
||||||
}
|
|
||||||
if (bindings[PascalName] === type) {
|
if (bindings[PascalName] === type) {
|
||||||
return PascalName
|
return PascalName
|
||||||
}
|
}
|
||||||
|
if (bindings[camelName] === type) {
|
||||||
|
return camelName
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const fromConst =
|
const fromConst =
|
||||||
|
|
Loading…
Reference in New Issue