fix(compiler-sfc): should keep template nodes with no content (#2468)

close #2463
This commit is contained in:
meteorlxy
2020-12-05 07:23:01 +08:00
committed by GitHub
parent db786b1afe
commit 5b9b37fc9b
2 changed files with 8 additions and 3 deletions

View File

@@ -138,7 +138,7 @@ export function parse(
if (node.type !== NodeTypes.ELEMENT) {
return
}
if (!node.children.length && !hasSrc(node)) {
if (!node.children.length && !hasSrc(node) && node.tag !== 'template') {
return
}
switch (node.tag) {