fix(compiler-core/compat): fix is prop usage on components
also fix v-bind:is usage on plain element in compat mode fix #3934
This commit is contained in:
@@ -57,8 +57,9 @@ function parseWithElementTransform(
|
||||
}
|
||||
}
|
||||
|
||||
function parseWithBind(template: string) {
|
||||
function parseWithBind(template: string, options?: CompilerOptions) {
|
||||
return parseWithElementTransform(template, {
|
||||
...options,
|
||||
directiveTransforms: {
|
||||
bind: transformBind
|
||||
}
|
||||
@@ -914,6 +915,18 @@ describe('compiler: element transform', () => {
|
||||
directives: undefined
|
||||
})
|
||||
})
|
||||
|
||||
// #3934
|
||||
test('normal component with is prop', () => {
|
||||
const { node, root } = parseWithBind(`<custom-input is="foo" />`, {
|
||||
isNativeTag: () => false
|
||||
})
|
||||
expect(root.helpers).toContain(RESOLVE_COMPONENT)
|
||||
expect(root.helpers).not.toContain(RESOLVE_DYNAMIC_COMPONENT)
|
||||
expect(node).toMatchObject({
|
||||
tag: '_component_custom_input'
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
test('<svg> should be forced into blocks', () => {
|
||||
|
||||
Reference in New Issue
Block a user