refactor(compiler-vapor): simplify ast check
This commit is contained in:
parent
0c33ace61c
commit
76595deefb
|
@ -112,9 +112,6 @@ function createSlotBlock(
|
||||||
}
|
}
|
||||||
|
|
||||||
function isNonWhitespaceContent(node: TemplateChildNode): boolean {
|
function isNonWhitespaceContent(node: TemplateChildNode): boolean {
|
||||||
if (node.type !== NodeTypes.TEXT && node.type !== NodeTypes.TEXT_CALL)
|
if (node.type !== NodeTypes.TEXT) return true
|
||||||
return true
|
return !!node.content.trim()
|
||||||
return node.type === NodeTypes.TEXT
|
|
||||||
? !!node.content.trim()
|
|
||||||
: isNonWhitespaceContent(node.content)
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue