fix(compiler-core): fix v-if block handling for components that fail to resolve

fix #2058
This commit is contained in:
Evan You
2020-09-14 12:41:35 -04:00
parent 24fcf6ae7c
commit a096a58e41
2 changed files with 5 additions and 11 deletions

View File

@@ -93,10 +93,12 @@ describe('compiler: v-if', () => {
expect((node.branches[0].children[0] as ElementNode).tagType).toBe(
ElementTypes.COMPONENT
)
// #2058 since a component may fail to resolve and fallback to a plain
// element, it still needs to be made a block
expect(
((node.branches[0].children[0] as ElementNode)!
.codegenNode as VNodeCall)!.isBlock
).toBe(false)
).toBe(true)
})
test('v-if + v-else', () => {